access query removes rows where the field is empty

for the location column: if I specify
Not Like 'X'

it will remove any row where location is X.  
But it will also remove rows where the location field is blank.

Since I didn't specify for it to remove the ones that are blank I would like to know how I can leave the rows where that field is blank
is null but that doesn't help.  "Not Like X" still removes the blank ones
vrosas_03Asked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
SELECT Table3.*
FROM Table3
WHERE (((Table3.location) Not Like "X" Or (Table3.location) Is Null));
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:

Try this:
Not Like 'X' OR Is Null

0
 
vrosas_03Author Commented:
Seems like it works if it's on the same line but I still don't understand why I should have to include what I never asked to be removed.   I would consider this to be a bug.  I guess I've been removing rows based on the other fields wherever there are blanks simply by using "Not Like".  I had to put it in the same line in the same criteria slot in the editor.
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
Well, it's not a bug ... just how it works.  I forget at the moment exactly why.

mx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.