Query does not return records with empty fields

jnmunsey

New member
Local time
Today, 23:19
Joined
Jul 19, 2002
Messages
9
EDIT - Looks like I found it - use the Nz function

SELECT ID, [Quote Number], [Company and Location], Equipment, Status
FROM [tblQuote-Log]
WHERE (Nz([Quote Number]) Like "*" & [Enter Quote Number:] & "*")
AND
(Nz([Company and Location]) Like "*" & [Enter Company/Location:] & "*")
AND
(Nz(Equipment) Like "*" & [Enter Description/Equipment:] & "*")
ORDER BY [tblQuote-Log].[Quote Number];



______________________
Original Post

Using Access 97, I made a query taking input for 3 different fields and returns records that match that input.

SELECT ID, [Quote Number], [Company and Location], Equipment, Status
FROM [tblQuote-Log]
WHERE (([Quote Number]) Like "*" & [Enter Quote Number:] & "*")
AND
(([Company and Location]) Like "*" & [Enter Company/Location:] & "*")
AND
((Equipment) Like "*" & [Enter Description/Equipment:] & "*")
ORDER BY [tblQuote-Log].[Quote Number];


Problem is this query does not return records that have empty fields(in Quote Num, Company/Loc, or Equipment)..

How can I get around this? I suspect this is a common question, and I will search for answers, but int he meantime if anyone can help - great!

Thanks,

John M
 
Last edited:

Users who are viewing this thread

Back
Top Bottom