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

"Not " and "or" query 1

Status
Not open for further replies.

sblanche

Technical User
Jun 19, 2002
95
US
I am trying to building a query. One field called "CounCrossSubject" has 20 available pick items. I want to show the records that have 17 of the items or is null. (I do not want to see records that have export, import or international*) In the query I can do

not "export" or is null - it works

however, when I add another item I want to exclude

Not "export" or not "International*" or is null

the query does not work. I still get "export". I don't want to add another line in my query for the 2 other "or"s (International* or Import) because I have other criteria to add which will probably require 6 other lines in my query grid. Any help would be greatly appreciated.
 
you get "export" because it is NOT INTERNATIONAL. you should use AND instead of OR:

(not "export" and not "international") or is null
 
When you start adding "not", "or" you need to group data with "()". Try

(Not "export" or not "International*" ) or is null
 
To tek-tips and all those people who help us do our jobs-
Thank you very, very much--Mission accomplished.
 
Opps--new problem with same query. It worked but when I enterred --
(not "export" and not "import" and not "*international*") or is null

Access change the 1 line into 2 and did--

<>"export" and <>"import and not like <>"*international*"

and then on the second line it added
Is Null

Any way to keep ACCESS from make 2 lines in the query?

Thanks,


 
I was concerned that I might run out of grid lines. I vaguely remember that on a previous query I could not add a 10th grid line to my query and was thus only allowed 9 lines. I might have to add more parameters to the query so the 3 additional lines concerned me. Since this AND and OR are in the same field instead of in different fields, I had hoped I could combine them. Thanks--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top