SQL (CAST) help - IBM AS400

This is a discussion on SQL (CAST) help - IBM AS400 ; Is it possible to sum on a cast??...

+ Reply to Thread
Results 1 to 3 of 3

Thread: SQL (CAST) help

  1. SQL (CAST) help

    Is it possible to sum on a cast??


  2. Re: SQL (CAST) help

    On 1 Nov., 12:04, jacko wrote:
    > Is it possible to sum on a cast??


    You mean something like this?

    Select Cast(Sum(MyCol) as Dec(15, 5))
    >From MyTable;


    Or

    Select Cast(Sum(Cast(MyCol as Integer) as Dec(11,2))
    Form MyTable;

    Birgitta


  3. Re: SQL (CAST) help

    jacko wrote:
    > Is it possible to sum on a cast??


    Of course.

    The SQL reference indicates that the argument for the
    SUM column function is 'numeric-expression'. The CAST
    scalar function returns a numeric expression.

+ Reply to Thread