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

Filtering Queries

Status
Not open for further replies.

solo7

Technical User
Mar 14, 2001
243
NO
I have 2 queries both of which return correct results. First query lists all students, second query list students who are in a specific class. How can I merge these two queries so that query 3 displays all students who are not assigned to the specific class?
Of course if there is a one query way I'm all ears ...

solo7 [thumbsup2]
 
you easiest way would be to use the query wizard and select "Find unmatched query".

The first table you would select would be Query 1 then select Query2, and link the field of Student name etc.

And that should display what you need.

Hope this helps.
 
One-query approach:
Code:
SELECT tblStudent.StudentID
FROM tblStudent LEFT JOIN tblCourse ON tblStudent.StudentID = tblCourse.StudentID
WHERE tblCourse.StudentID Is Null
Hope this helps.

[pc2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top