Subject sum and the 'iif' operator
Author Nigel Weeks
Hi all,



Trying to do some simple aged balances on a transaction table, and having
issues.



Can anyone see what I'm doing wrong?



SQL Command:

select int_contactid,

sum(

iif(('now' - dtm_stamp < 30), flt_amount,0)

),

sum(

iif((('now' - dtm_stamp) between 30 and 60), flt_amount, 0)

)

from tbl_transaction

group by int_contactid



Feedback:

Dynamic SQL Error expression evaluation not supported



Any ideas?

How do other people do aged balances, apart from individual queries /
subselects for each range...



Thanks in advance!

Nige.







[Non-text portions of this message have been removed]