unmatched query

R

rhys

Hello,
I am using an unmatched query on two tables (A and B) and then appending the
unmatched data into table A. This works fine. However to make it work
100%correctly I need to find all unmatched data based on two fields.
Let me explain;
In tables A and B I have person codes and course codes.
A person can have more than one course code and a course code can belong to
more than one person.
An unmatched query on person code produces all the people who aren't already
in table A. An unmatched query on course code produces all the courses that
aren't in table A.
I need to do the query so that it finds the person code and their course
code that aren't in table A even if the person is already in table A with
another course code.

I'm not sue how I would go about doing this. Any help would be great.

Rhys
 
A

Arvin Meyer [MVP]

Funny, I just had to do this exact thing earlier this week. I ran a query on
the Course registration table with an In() clause (You can also use OR)
because I had several course to check. Once I had all the folks who had
taken the courses:

SELECT DISTINCT tblRegistration.ID
FROM tblRegistration
WHERE (((tblRegistration.CourseID) In (8,9,10)));

I ran this query linked to another to get everyone else who hadn't taken
courses 8, 9, or 10:

SELECT Members.[ID], Members.[FirstName], Members.[LastName]
FROM Members LEFT JOIN qry8910 ON Members.[ID] = qry8910.ID
WHERE (((qry8910.ID) Is Null))
ORDER BY Members.[ID];

--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top