Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    May 2005
    Posts
    180
    Thanks
    0
    Thanked 0 Times in 0 Posts

    is not null (2003)

    I would like to look for non-null records from a query. I have tried strSQL = "SELECT * FROM qryA WHERE email Is Not Null;". I can't seem to get the syntax correct. Any help would be appreciated

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: is not null (2003)

    The syntax is correct, as far as I can tell.

    Do you get an error message? If so, what exactly does it say?

    If you don't get an error message, but the SQL statement doesn't return any records, there may be zero-length strings in the email field instead of Null. You might try
    <code>
    strSQL = "SELECT * FROM qryA WHERE Not (email & '' = '')"
    </code>
    Note the use of single quotes within the string delimited by double quotes.

  3. #3
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: is not null (2003)

    You could try:

    SELECT * FROM qryA WHERE Len(email) > 0

Posting Permissions

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