On 1 Nov., 12:04, jackowrote:
> 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
This is a discussion on SQL (CAST) help - IBM AS400 ; Is it possible to sum on a cast??...
Is it possible to sum on a cast??
On 1 Nov., 12:04, jackowrote:
> 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
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.