|
Posted by Ed Murphy on 10/11/46 11:59
Don wrote:
> If I have an SQL query which returns an aggregate of several decimal fields
> like so:
>
> (sum(COALESCE(myDecimal1, 0)+
> sum(COALESCE(myDecimal2, 0)+
> sum(COALESCE(myDecimal3, 0)) as MyTotal
>
> I get an rounded integer in MyTotal.
>
> However, if I do the following:
>
> sum(COALESCE(myDecimal1, 0)+
> COALESCE(myDecimal1, 0)+
> COALESCE(myDecimal1, 0)) as MyTotal
>
> I get a (proper) decimal value.
>
>
> Does anyone know why the first case returns an Integer?
What do the following return?
sum(coalesce(myDecimal2,0)) as MyTotal2
sum(coalesce(myDecimal3,0)) as MyTotal2
Navigation:
[Reply to this message]
|