Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excluding null values from query result (2003)

    I am writing a query to exclude null values from a query result but for some reason it keeps bringing up NULL values all the time, see screenshot.
    Query:

    <"01/11/06" And Is Not Null

  2. #2
    3 Star Lounger
    Join Date
    Dec 2001
    Location
    Royal Oak, Michigan, USA
    Posts
    255
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excluding null values from query result (2003)

    See my reply to your other post.

  3. #3
    Silver Lounger GARYPSWANSON's Avatar
    Join Date
    Aug 2001
    Location
    Frederick, Maryland, USA
    Posts
    1,788
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Excluding null values from query result (2003)

    Your less then is referencing a string by putting the dates in double quotes. Wouldn't this give you a type mismatch error or is your date field a text value? If the date field is a text value then you need to convert it to a date value where you can use the less then criteria.

    Are you sure the blank is a null value or perhaps it it a space. Retry your query after converting the date column to a date type field.
    Regards,

    Gary
    (It's been a while!)

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Excluding null values from query result (2003)

    I understand that you will try converting to a date, but also.
    Imported data often contains zero length strings in fields that appear empty. So to exclude them you need to test for ""

    <"01/11/06" And Is Not Null and <>""
    Regards
    John



  5. #5
    4 Star Lounger
    Join Date
    Jul 2006
    Posts
    531
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excluding null values from query result (2003)

    Thanks for that, that

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •