A
anyaley via AccessMonster.com
I have an expression which subtracts total debit from total credit for each
account group of transactions to give the balance in a calculated field
called Balance. i.e Balance: Sum(([CrAmount]-[DrAmount])) It works OK. But
now I want to make it conditional based on field named Acctype.
If Acctype is "D", Balance: Sum(([DrAmount]-[CrAmount]))
If Acctype is "C", Balance: Sum(([CrAmount]-[DrAmount]))
How can I use one expression using iif condition in my query. I tried
something like this:
iif ([Acctype]="D",Sum(([DrAmount]-[CrAmount])) ,Sum(([CrAmount]-[DrAmount]))
It gave aggregate error message. Please help.
Alex
account group of transactions to give the balance in a calculated field
called Balance. i.e Balance: Sum(([CrAmount]-[DrAmount])) It works OK. But
now I want to make it conditional based on field named Acctype.
If Acctype is "D", Balance: Sum(([DrAmount]-[CrAmount]))
If Acctype is "C", Balance: Sum(([CrAmount]-[DrAmount]))
How can I use one expression using iif condition in my query. I tried
something like this:
iif ([Acctype]="D",Sum(([DrAmount]-[CrAmount])) ,Sum(([CrAmount]-[DrAmount]))
It gave aggregate error message. Please help.
Alex