Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query not recognizing null fields. 1

Status
Not open for further replies.

cdgeer

IS-IT--Management
Apr 8, 2008
133
US
I have a query that looks for null values in 2 fields. The criteria expression I use is:
Is Null Or Like "" Or Like ' *'
But it still misses some rows with blank fields where the expression should pick them up. Is there something else I could add to the criteria expression? I always thought those 3 things should cover it.


 
Is Null Or Like "" Or Like ' *'
Please post the WHERE clause of the SQL code.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
WHERE ((([" & TableNew & "].EEID) Is Null Or ([" & TableNew & "].EEID) Like "" Or ([" & TableNew & "].EEID) Like ' *') AND (([" & TableNew & "].[SYS/GenericAcct]) Is Null Or ([" & TableNew & "].[SYS/GenericAcct]) Like "" Or ([" & TableNew & "].[SYS/GenericAcct]) Like ' *'));
 
Well, seems not like a pure SQL code...
My guess:
WHERE Trim([" & TableNew & "].EEID & '')='' AND Trim([" & TableNew & "].[SYS/GenericAcct] & '')=''

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks PHV! That seems to work fine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top