Results 1 to 3 of 3
  1. #1
    bgephart is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2012
    Posts
    15

    Can I count Null values in a totals query?

    I have a totals query that I am trying to use to count only the Null values in a date field. So far, I'm only getting a total count regardless of what's in the field. Is this even possible? If not, can you suggest a work-around?

    I'm writing this in Access 2007 but it is in 2003-compatible format.



    Thanks -

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    One way is to create a calculated field that returns a 1 if the Date field is Null, or else it returns a 0, i.e.
    Code:
    IIf(IsNull([MyDate]),1,0)
    Then use the SUM aggregate function on this field.

  3. #3
    bgephart is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2012
    Posts
    15
    Thanks! That fixed it!

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

Similar Threads

  1. Replies: 6
    Last Post: 04-26-2012, 10:00 PM
  2. Count query return zero instead of null/blank
    By dhicks19 in forum Queries
    Replies: 1
    Last Post: 04-19-2012, 07:52 AM
  3. Count() and Null Values
    By jpvonhemel in forum Queries
    Replies: 4
    Last Post: 10-21-2011, 03:37 AM
  4. Query with null values
    By Psyclone in forum Queries
    Replies: 3
    Last Post: 03-30-2011, 09:57 PM
  5. use 0 for null value in count query
    By hyperionfall in forum Queries
    Replies: 1
    Last Post: 11-07-2010, 05:12 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