[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

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
0
vrosas_03
Asked:
vrosas_03
  • 3
1 Solution
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:

Try this:
Not Like 'X' OR Is Null

0
 
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)Commented:
SELECT Table3.*
FROM Table3
WHERE (((Table3.location) Not Like "X" Or (Table3.location) 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 MVP, Access and Data Platform)Commented:
Well, it's not a bug ... just how it works.  I forget at the moment exactly why.

mx
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now