Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,850
    Here is a sample of where NZ goes and why.



    I created a table with the following design(see graphic

    There is NO DATA in the Table

    I then created a query in the SQL View of the query wizard. Since there is no data in the table, there is really nothing to Sum. So in my query, I Sum(fld1) and put a label (SumResult) on the calculation; also I use the NZ function on Sum(fld1), to display a 0 if there is no value. This is Nz(Sum(fld1),0) and I have added a label(ShowMeAZero) on this calculation.

    Code:
    SELECT Sum([fld1]) AS SumResult, Nz(Sum(fld1),0) AS ShowMeAZero
    FROM tblStampman;
    The result of the query is
    Code:
    SumResult ShowMeAZero
    0
    Good luck with your project.

    Post posting: I see you responded - or gave up - while I was creating a sample to show you where NZ goes in a query and what the result of NZ is. This is a basic query. It doesn't get much easier than this.
    I suggest you watch a few youtube videos, or do some tutorials at RogersAccessLibrary

    Approach this whole thing as a learning opportunity - not something to be feared.

    Again, sincere good luck with your project.
    Attached Thumbnails Attached Thumbnails tblStampman.jpg  

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    NOTE: Threads merged.

    StampMan, if you want a record to show in report for an entity even if that entity has no data, that gets complicated.

    Say you have a table of Departments and a table for Expenses and you want to show the total expenses for each department for the month of July. If department A has no expenses in July then they won't show on the report. Forcing Department A to show a record for July in the report even if they don't have data requires more complex query structure.

    Is this what you want?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #18
    StampMan is offline Novice
    Windows 8 Access 2013
    Join Date
    Oct 2014
    Location
    Perth, Western Australia
    Posts
    24
    Thank you all for your efforts on this. I REALLY do appreciate it.

    I just went with creating a false record with values of zero in it to solve the issue. Sooner or later that table will need a record added legitimately and therefore I will just overwrite the false one and things are all honky-dorey lol.

    Thanks so much for all of your attention. :-)

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 02-06-2015, 03:58 AM
  2. Replies: 1
    Last Post: 01-05-2013, 10:46 PM
  3. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  4. Replies: 1
    Last Post: 08-23-2012, 08:32 AM
  5. How to make Report omitting "Done" jobs?
    By SHogan in forum Reports
    Replies: 6
    Last Post: 02-24-2012, 06:57 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