I have a select statement with a sum on a field that contains an iif statement and it looks as though the iif is truncating the value...

&& Example

select
   sum(iif(SomeCondition,ValueX,0)) as TotalValueX
from
   curATable

if ValueX had values of 1.2 and 3.4 the answer would be 4.

But this works...

select
   sum(iif(SomeCondition,1,0) * ValueX) as TotalValueX
from
   curATable

return s 4.6

has anyone seen this before?

--
Michael Hawksworth
Visual Fox Solutions

[EMAIL PROTECTED]
www.foxpro.co.uk





_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to