Results 1 to 2 of 2
  1. #1
    Nixx1401 is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Feb 2010
    Location
    Barbados
    Posts
    115

    Help with if statement in report

    I have a report which is generated from a query. The report displays the individual name and the currency amount that person possess.



    These are the fields: Transaction Number, Transaction Date, Name, ID, Amount Withdrawn, Amount Deposited and the currency is grouped. This formula here calculates the currency balance
    =Sum([curDepositAmt])-Sum([curWithdrawAmt]) but if the withdrawn amount is blank it return no value for the currency balance

    Can someone assist me with the formula. This is what is came up with but I am getting an error

    =iif([WithdrawnAmt]="Is Null" =Sum([curDepositAmt], =Sum([curDepositAmt]- =Sum(curWithdrawnAmt])

    If the withdrawn amount is blank display the deposit amount if not subtract the sum of deposits from sum of withdrawals

  2. #2
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,046
    Hi,

    try the NZ function: this function replaces the null value with the value you give in the second argument

    =Sum([curDepositAmt])-Sum(NZ([curWithdrawAmt],0))

    greetings
    NG

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

Similar Threads

  1. If Statement in Report
    By Nixx1401 in forum Reports
    Replies: 3
    Last Post: 07-01-2010, 04:14 PM
  2. IIf Statement...HELP!
    By bdhFS in forum Queries
    Replies: 5
    Last Post: 05-19-2010, 07:55 AM
  3. Problem With IF Statement
    By MuskokaMad in forum Programming
    Replies: 0
    Last Post: 03-14-2010, 05:26 PM
  4. IIF statement
    By james1982 in forum Access
    Replies: 1
    Last Post: 07-20-2009, 09:38 AM
  5. how to use IF then statement
    By ronnie4 in forum Access
    Replies: 1
    Last Post: 03-17-2009, 11:32 PM

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