Results 1 to 4 of 4
  1. #1
    Huddle is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    318

    Count if Null Expression


    I have an expression in an unbound field on a report. I'm getting a syntax error. I need it to count the 'Command' data if it is null or contains a 0.

    =Count(IIf(IsNull[command],0,(IIf([Command]=0,0))))

    Where am I getting it wrong
    Last edited by Huddle; 03-07-2012 at 04:16 PM.

  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,521
    No parentheses for the IsNull function:

    IsNull(Whatever)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Huddle is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Jun 2010
    Posts
    318
    thanks for your help

  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,521
    No problem.
    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: 02-23-2012, 02:27 PM
  2. Count() and Null Values
    By jpvonhemel in forum Queries
    Replies: 4
    Last Post: 10-21-2011, 03:37 AM
  3. Displaying Count if Null value exists
    By adams.bria in forum Queries
    Replies: 3
    Last Post: 08-31-2011, 11:56 AM
  4. Replies: 1
    Last Post: 02-25-2011, 06:11 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