Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2009

    Unanswered: Query returning a null value instead of zero


    I have a query that filters merchandise by month of arrival (query1) and then another query (query2) that adds the price of every single item that was filtered by the previous query. The problem is that if nothing arrives in one given month, the first query returns empty (no problem so far). Now comes the problem: when the first query returns empty, the second one still adds the prices but instead of saying that the total price of merchandise bought is zero, it also returns empty. How do I get around this problem? (I need the second query returning the value zero to make further calculations)
    Last edited by franchico; 08-13-09 at 12:24. Reason: explain myself better

  2. #2
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    "Null" is synonymous with "unknown". By including "null" in any kind of aggregate value, you're saying, "1 + 5 + 15 + unknown = ???".

    What you need to do is provide a REAL value, instead of unknown (null). You can use the nz() function to do that.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    Aug 2009
    Thanks Teddy.

    I used Nz(Sum(anything))+0

Posting Permissions

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