Results 1 to 4 of 4
  1. #1
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125

    Not showing records with null sum

    This seems rather trivial. I have a query joining two tables: tblSegments & tblSubmittals. The query I'm creating totals weights for Submittals based on a segement. The problem I'm having is that there are Segments that are created that don't have weight entered for them yet in the submittals table. The query of course leaves these out, but I would like to seem them, with a total weight of zero. This is the expression I'm using for the field I want in my query:

    DetWgt: Sum(Nz(([dbo_tblSubmittals].[DetWgt]),0))

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    That should work if there are records in that table with Null weights. My guess is that there are no records at all in that table. In that event, the usual solution would be to change the join between the tables. You can right click on the join line in design view to change it, or in SQL view change INNER to LEFT or RIGHT as appropriate.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    eww is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Aug 2010
    Posts
    125
    Ah! Right you are Paul. Thanks!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    No problemo!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 03-09-2011, 02:04 AM
  2. Query not showing all records
    By gazzieh in forum Queries
    Replies: 2
    Last Post: 02-17-2011, 08:11 AM
  3. Replies: 1
    Last Post: 02-16-2011, 09:08 AM
  4. Replies: 7
    Last Post: 12-07-2009, 07:27 AM
  5. Null Values not showing up in a Query
    By Valli in forum Queries
    Replies: 0
    Last Post: 01-04-2006, 03:53 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