How do I set up an "unmatched query" on 2 fields. the wizard onl

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

How do I set up an "unmatched query" on 2 fields. the wizard only allows 1
field to be joined. does anyone have an example they can send me.
ex. i need to check both a 'student_id' and a 'course-number' as not being
in 1 of the tables.
 
On Tue, 26 Jul 2005 16:36:01 -0700, "Sam H" <Sam
How do I set up an "unmatched query" on 2 fields. the wizard only allows 1
field to be joined. does anyone have an example they can send me.
ex. i need to check both a 'student_id' and a 'course-number' as not being
in 1 of the tables.

Create a Query joining the two tables, dragging Student_ID to
Student_ID and Course_Number to Course_Number.

Select BOTH join lines in the query design window; choose Option 2 -
"Show all records in <table1> and matching records in <table2>". Then
put a criterion of IS NULL on either one of these fields from the
second table. The SQL will be something like

SELECT <whatever> FROM <table1>
LEFT JOIN <table2>
ON <table1>.Student_ID = <table2>.Student_ID
AND <table1>.Course_Number = <table2>.Course_Number
WHERE <table2>.Student_ID IS NULL;

This will show all records in <table1> with no matching records in
<table2>.

John W. Vinson[MVP]
 
Back
Top