Subtracting the sub total instead of adding in Grand Total

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • didajosh
    New Member
    • Aug 2008
    • 47

    Subtracting the sub total instead of adding in Grand Total

    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 :
    Code:
    (IIf ([Org-code] = '601', sum (amount)) -
    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
    Last edited by NeoPa; Feb 25 '10, 11:13 PM. Reason: Please use the [CODE] tags provided
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32634

    #2
    Try :
    Code:
    Sum(IIf([Org-Code]='601',[Amount],IIf([Org-Code]='602',-[Amount],0)))

    Comment

    • didajosh
      New Member
      • Aug 2008
      • 47

      #3
      NeoPa....
      this works...this works...this works...!!!!!
      i was loosing my mind...thank you soo much....i really appreciate it...

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32634

        #4
        Not a problem. That's why we're here really - to help people do what we have some experience in :)

        Comment

        Working...