Problem With Wildcard Query

crhodus

Registered User.
Local time
Today, 04:47
Joined
Mar 16, 2001
Messages
257
I'm trying to create a query that will kick out any records that have the word Closed in one of my fields.

SELECT Company_T.*
FROM Company_T
WHERE ((([Company_T].[COMPANY_CLIENT_STATUS]) NOT LIKE "*" & "CLOSED" & "*"))
ORDER BY [Company_Name];

This query somewhat works. It does not display any record with the word Closed in it, but it also does not dispaly any records that have a blank entry for this field. It is only returning records that have something typed in this field.

Am I doing something wrong or do I need to add something to this query?

Thanks!
 
Change it to this:

SELECT Company_T.*
FROM Company_T
WHERE ((([Company_T].[COMPANY_CLIENT_STATUS]) NOT LIKE "*CLOSED*"))
ORDER BY [Company_Name];
 
Thanks for your help! The IS NULL statement did the trick.
 

Users who are viewing this thread

Back
Top Bottom