INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Testing for no value in a recordset field

Testing for no value in a recordset field

(OP)
Hi

  I have a table with 5 fields
      Dates   Date/Time
      User_1  Text
      User_2  Text
      User_3  Text
      User_4  Text

When I use the statement below, my recordset consist of every date that has a value in all four of the user fields

SELECT Dates,User_1,User_2,User_3,User_4
FROM Schedule
WHERE ((User_1<>" ") AND (User_2<>" ") AND (User_3<>" ") AND (User_4<>" "));

This statement worked fine and pull all the correct records



My question is how do I write this statement to show me every date that does not have any records in all four of the fields? Simply stated how do you test for nothing in a field?

The statement below failed to show any records, I also tried
Is Null with no better results

SELECT Dates,User_1,User_2,User_3,User_4
FROM Schedule
WHERE ((User_1=" ") AND (User_2=" ") AND (User_3=" ") AND (User_4=" "));

Thanks
Mike

RE: Testing for no value in a recordset field

Is Null should definitely work. Are you quite sure that none of the User_X fields have not got a space (or spaces) in them rather than actually being null/zero-length strings?

RE: Testing for no value in a recordset field

There's a little trick that you can use to handle NULLs, zero length strings and blank strings

CODE

WHERE     Trim$(User_1 & "")=""
      AND Trim$(User_2 & "")=""
      AND Trim$(User_3 & "")=""
      AND Trim$(User_4 & "")=""
 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close