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

Using Not Operator

Status
Not open for further replies.

ba4crm

Technical User
Dec 19, 2003
92
US
Hi,
I have a table that has Code Description, and Code Id. Both are text fields. The code id is made up of numbers and alphabets. I am trying to write a query to pull only those records that do not have certain characters in the code id. Example: I would like to see only those codes that do not have the characters AB*, Z1*, *W3 in the code id. What is the easiest way of doing this?

Thank you
 
As in (?)
[tt]SELECT CodeID
FROM tblTable
WHERE CodeID Not Like "AB*"[/tt]
 
One way (SQL code snippet):
WHERE [Code Id] Not Like '*AB[*]*' AND [Code Id] Not Like '*Z1[*]*' AND [Code Id] Not Like '*[*]W3*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top