Using results of one query as criteria for another

mjdavie

Registered User.
Local time
Today, 17:01
Joined
Sep 17, 2001
Messages
34
I have a query that returns a number of clients (ID, Name, Address) This works fine.

What I want to do is create another query that returns every client except for the one's returned in my first query.

Can anybody help me with this

Thanks in Advance
Matthew
 
In the criteria for the query just add Not at the start of the criteria. e.g.

Not Between #01/01/99# And #01/05/99#

Instead of Between #01/01/99# And #01/05/99#

David
 
I am using the Not Statement which works fine
when my first query returns only one record, however if my first query returns more than one record then my second query seems to ignore the criteria.

Thanks for your help
 
You can do it many ways. One of them using NOT IN

SELECT ID, Name, address
FROM [Clients]
WHERE ID Not In (
SELECT [Client].ID
FROM [Client]
WHERE conditionOfQry1 ) ;
 

Users who are viewing this thread

Back
Top Bottom