Results 1 to 2 of 2
  1. #1
    jobbie is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Apr 2014
    Posts
    46

    sum and iif

    I am trying to run this query in ms access 2007:

    Code:
    "Bank": Sum(IIf(Debit_Ac="Bank",Amount))-Sum(IIf(Credit_Ac="Bank",Amount))
    but I always get a blank if there is no "Bank" entry in the "Credit_Ac" column.



    I have tried
    Code:
    "Bank": Sum(IIf(Debit_Ac="Bank",Amount))
    and it correctly shows the value.

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,932
    use the nz function

Please reply to this thread with any new information or opinions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums