By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,456 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,456 IT Pros & Developers. It's quick & easy.

Subtracting the sub total instead of adding in Grand Total

didajosh
P: 47
I am grouping a report on the basis of "Org-Code".
There are two "Org-Code"- "601" Income and "602" Expense.
It calculates sub totals accordingly.
In the grand total, it simply sums everything. Instead I want the difference.

I tried adding a Text box in the report footer field, and its control source as :
Expand|Select|Wrap|Line Numbers
  1. (IIf ([Org-code] = '601', sum (amount)) -
  2. IIf ([Org-code] = '602', sum (amount)) )
This does not work.

I hope I am making sense, if it does not please let me know.

Thanks and Regards,
Dipali
Feb 25 '10 #1

✓ answered by NeoPa

Try :
Expand|Select|Wrap|Line Numbers
  1. Sum(IIf([Org-Code]='601',[Amount],IIf([Org-Code]='602',-[Amount],0)))

Share this Question
Share on Google+
3 Replies


NeoPa
Expert Mod 15k+
P: 31,186
Try :
Expand|Select|Wrap|Line Numbers
  1. Sum(IIf([Org-Code]='601',[Amount],IIf([Org-Code]='602',-[Amount],0)))
Feb 25 '10 #2

didajosh
P: 47
NeoPa....
this works...this works...this works...!!!!!
i was loosing my mind...thank you soo much....i really appreciate it...
Feb 26 '10 #3

NeoPa
Expert Mod 15k+
P: 31,186
Not a problem. That's why we're here really - to help people do what we have some experience in :)
Feb 27 '10 #4

Post your reply

Sign in to post your reply or Sign up for a free account.