Results 1 to 5 of 5
  1. #1
    forrestapi is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    39

    No return on Null values

    I just want to check and see if this is normal behavior.

    I have a query that with no "criteria" returns 1294 records. In one of the columns(lets call it Status) i have chosen to exclude the criteria "cancled". There are 49 records that this should exclude and leave a total of 1245. Instead i get 106. After some digging through i have realized what the problem is. When the query runs it is also excluding any records with a null value in the Status Column (there are a total of 1188 of these records). I have verified this is the issue by including "Is Null" in the "Or" section of the "Status" column. When doing this, it correctly displays the 1245 records.

    So what im wanting to know is, is it normal behavior for a query to not return results on a record if the criteria you are using is bounced against a "null" field.

    Any help would be great, Thanks!

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    you write: i have chosen to exclude the criteria "cancled".

    (ignoring the typo)

    'exclude' ??? so your criteria is everything that is NOT = "canceled"?? what syntax do you use....because criteria shows everything that IS (i.e. "canceled")

    if one just puts that word in the criteria field.... your 'criteria' is that it must say 'canceled'...thus a null would not satisfy that criteria.

    hope this helps.

  3. #3
    slave138's Avatar
    slave138 is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Oct 2010
    Location
    WI
    Posts
    233
    The actual query would go a long way to figuring out if it's doing something unusual...

  4. #4
    forrestapi is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    39
    Quote Originally Posted by NTC View Post
    you write: i have chosen to exclude the criteria "cancled".

    (ignoring the typo)

    'exclude' ??? so your criteria is everything that is NOT = "canceled"?? what syntax do you use....because criteria shows everything that IS (i.e. "canceled")

    if one just puts that word in the criteria field.... your 'criteria' is that it must say 'canceled'...thus a null would not satisfy that criteria.

    hope this helps.
    Im sorry I left out some detail the syntax entered in the critera field is actually" <> canceled" . But yes I know without that syntaxit would only pull like items, not unlike.

    Quote Originally Posted by slave138 View Post
    The actual query would go a long way to figuring out if it's doing something unusual...
    I agree, however I left the query at work and am currently at home. If no one can make sense of this I will try and post the query first thing monday.

  5. #5
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    Please remember, null neither equal (=) any value, nor (not equal)(<>) any value, even doesn't equal another null. So:
    null <>"canceled" return false
    null ="canceled" return false
    null = null return false ( we can put null incritia cell to catch the null values because Access translate it to "is null", not "=null", if we put "=null" there, we can not catch anything)

    If you also want the records with null, put <>'cancel' or is null as the criteria.

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

Similar Threads

  1. Return 0 instead of null
    By salisbut in forum Queries
    Replies: 1
    Last Post: 08-07-2010, 12:01 PM
  2. Null Values in query
    By LesleaOH in forum Queries
    Replies: 0
    Last Post: 10-19-2009, 04:45 PM
  3. Return all values from two queries
    By matteu1 in forum Queries
    Replies: 0
    Last Post: 08-18-2009, 01:02 PM
  4. Fill in Null values
    By Petefured in forum Queries
    Replies: 1
    Last Post: 10-06-2008, 12:54 PM
  5. HELP with NULL DateTime VALUES
    By lfolger in forum Programming
    Replies: 3
    Last Post: 03-28-2008, 02:33 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