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

Criteria required for excluding multiple records in a query

Status
Not open for further replies.

ollie1

Technical User
Oct 11, 2001
16
AU
I have a table with an address field. There are multiple records under this field eg Smith Street, Brown Street, Paul Street, etc. I want to create a query that will exclude multiple records under the address field. Eg The query will exclude all the entries that have Smith Street and Brown Street under the address field in the result.


Ollie

[sadeyes]
 
Are you asking what the query should look like?

Select * from table1 where address not in ('Smith Street', 'Brown Street')

Transcend
[gorgeous]
 
Sorry I'll try and explain a little clearer, using Microsoft Access is a pretty new deal for me.
I know that if I want to exclude a single record from a query I can put a criteria in that says Not "Paul Street".

I don't know what to put in the criteria to exclude multiple records.

Hope this explains a bit better.

Cheers
Ollie

[sadeyes]
 
Hmm, it's not clear to me what you're after. Perhaps look up "DISTINCT", "DISTINCTROW", and "GROUP BY" in Help's Answer Wizard for some ideas?
Cheers!
Steve
 
To put in multiple records arrow down after typing in Not "Pauls Street". (I assume you're talking about design view ? )

Just arrow down and type in the next criteria

Not "Paul Street"
Not "This Street"
Not "That Street" etc

Transcend
[gorgeous]
 
Transcend
Thanks for the reply. Yeah I am in Design View. I had tried what you suggested , but it was unsuccessful. It would only exclude the first NOT record.

Steve

Thank you for your reply but I need a simple solution. I did what you said to lookup help but to be truthful I didn't understand it.

I just need a simple expression in the criteria section(in design view) to exclude a couple of the records from the field.

Thank you for your patience.

Ollie [sadeyes]
 
It would be great to get an answer on this. I've tried to exclude mutiple items in a single query and it never works. Can someone please help us out in this area?

Thanks,
-Doug
 
The answer is in the first reply:
Not In ('value1','value2',....,'valueN')

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