View Full Version : Is it possible


gblack
02-20-2007, 12:19 PM
I have a set of codes in field name [Code]

What i want to do is to

Select [Code] from TableA Where....


Here's the problem. What I want to do is exclude all the Codes that end in "AC" except two (0001AC and 0016AC).

How might I wirte the SQL statment to do that?

pbaldy
02-20-2007, 12:29 PM
Try

WHERE Right(CODE, 2) <> "AC" OR CODE = "0001AC" OR CODE = "0016AC"

mhartman
02-20-2007, 12:33 PM
Hello: The statement would be......

SELECT Table1.Code
FROM Table1
WHERE ((Not (Table1.Code)="0001AC" And Not (Table1.Code)="0016AC"));

Use your table and field names though

Regards
Mark