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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with filtering Query in Access 3

Status
Not open for further replies.

jeevenze

Technical User
Mar 13, 2001
62
US
I have the following query:

SELECT [tblcatalog].[prodID], [tblcatalog].[catID], [tblcatalog].[prodTitle], [tblcatalog].[prodDesc], [tblcatalog].[prodSize], [tblcatalog].[prodShipInfo], [tblcatalog].[prodPrice], [tblcatalog].[prodSmPic], [tblcatalog].[prodLgPic], [tblcatalog].[artistID], [tblcatalog].[date_inserted], [tblcart].[sold]
FROM tblcatalog LEFT JOIN tblcart ON [tblcatalog].[prodID]=[tblcart].[prodID]
WHERE [tblcart].[sold] = 'Y'

This selects all the records where the value 'Y' is in the 'sold' field.

How can i get the query to select all records where the field 'sold' is empty?

Any help is much appreciated.
Thanks

Jeevenze
 
i have a query where i search for a date field with no date and i use IS NULL in the criteria. i'm not sure if a character field would be different. or try " ".
 
Have you tried..

WHERE [tblcart].[sold] IS NULL

Once you have no default values set and are not using boolean values for the field, this should work.

Brendan

 
WHERE [tblcart].[sold] IS NULL
this worked, thank you.

Someone also suggested
WHERE nz([tblcart].[sold],"")=""
and it also works.
 
The difference between the 2 suggestions is that WHERE [tblcart].[sold] IS NULL will only look for Null values where as WHERE nz([tblcart].[sold],"")="" will also look at empty or blank values .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top