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

Multiple "Not Equal" Criteria

Status
Not open for further replies.

CCRT

Technical User
Jul 27, 2005
14
0
0
US
What is the correct format to declare a multiple “Not Equal” criteria?


I’ve made a sample table that contains one field named “Color”
I’m querying the field using criteria of Not "Blue" Or "Red"

The query result only excludes the value “Blue” the value “Red” remained.

What an I doing incorrectly?


SELECT tblColor.Color
FROM tblColor
WHERE ((Not (tblColor.Color)="Blue" Or (tblColor.Color)="Red"));


Thanks for any help with this

--Dave


 
Try this:

SELECT tblColor.Color
FROM tblColor
WHERE Not ((tblColor.Color)="Blue" Or (tblColor.Color)="Red");
 
Hi Dave!

You can also do it like this:

SELECT tblColor.Color
FROM tblColor
WHERE tblColor.Color Not In ("Blue", "Red");

hth


Jeff Bridgham
Purdue University
Graduate School
Data Analyst
 
Thanks
They both work great.....

The later "mp9's" Is a little easier to input into a grid view criteria But the use of "Or" in "PaultheS" make more sense to me.

Oh well, thanks to both of you for such quick responses.

--Dave

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top