Results 1 to 3 of 3
  1. #1
    Join Date
    May 2009
    Location
    Crete, Greece
    Posts
    90

    Unanswered: Help with on syntax for simple subtraction in query

    Hi everyone.

    I need to subtract one field from another in a query. I have

    AmountOutstanding: [InvoiceAmount]-[AmountPaid]

    in the 'field' line of my query, but if the AmountPaid field is empty, then the AmountOutstanding field also remains blank. I want the AmountOustanding field to be the same as InvoiceAmount, except if a payment has been made (AmountPaid), when [AmountPaid] should be subtracted.

    I'm sure this is an easy answer for somebody. Many thanks.

  2. #2
    Join Date
    Apr 2004
    Location
    Derbyshire, UK
    Posts
    789
    Provided Answers: 1
    Hi

    How about

    AmountOutstanding: [InvoiceAmount]-Nz([AmountPaid],0)

    ??

    MTB

  3. #3
    Join Date
    May 2009
    Location
    Crete, Greece
    Posts
    90
    Perfect. Thanks a million.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •