How do I use NOT in a query for multiple items?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to write a query and in one of my fields I want to list multiple
data that I do not want returned. Example....Not like JCO or VOP or WARR.
How can I do this?
 
blingbling said:
I am trying to write a query and in one of my fields I want to list
multiple data that I do not want returned. Example....Not like JCO
or VOP or WARR. How can I do this?

Your example used "like" which is normally associated with wild card
matching "parts" of field values. Is that what you really want? That would
loook like...

WHERE FieldName Not Like "*JCO*" AND FieldName Not Like "*VOP*" AND
FieldName Not Like "*WARR*"

Exact matches (no wild card) are easier.

WHERE FieldName <> "JCO" AND FieldName <> "VOP" AND FieldName <> "WARR"

(or somewhat shorter)

WHERE FieldName Not In("JCO", "VOP", "WARR")\
 
Back
Top