Difference Query

  • Thread starter Edward Jones (Eddie)
  • Start date
E

Edward Jones (Eddie)

I am trying to run a query on two tables to find the last name and first name
pairs that do not apear in both tables. I can obviously get the union but how
do i get the difference. Thank you for all your help.
 
O

Ofer

When you create a query, run the wizard and select the Query that return the
unmatch records.
 
E

Edward Jones (Eddie)

I ran the query wizard but i do not see where to specify unmatched records.
Thank you.
 
O

Ofer

This query example return the LastName in table1 that are not in table2, I'm
using a right join between the two fields, and ask for all the name that are
null in table 2 which they are not there
Hope that help

SELECT MyTable1.Last_Name
FROM MyTable2 RIGHT JOIN MyTable1 ON MyTable2.Last_Name = MyTable1.Last_Name
WHERE MyTable2.Last_Name Is Null
 
Top