how do I find unmatched records from two tables?

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

Guest

How do I compare 2 number fields btw 2 tables to id records where the numbers
don't match, and return some kind of an error msg? Thnx.
 
You could use the unmatched query wizard to build a query to show the
records in tablea not in tableb and a second query to show the records in
TableB that are not in TableA.

You can't have the query return an error message.

If you are trying to do this in VBA you could use the DLookup function to
see if any one number existed in TableA and in TableB.

Sample query to find unmatched records in TableA:
SELECT TableA.*
FROM TableA Left Join TableB
ON TableA.NumberField = TableB.NumberField
WHERE TableB.NumberField is Null
 
Thanks.

John Spencer said:
You could use the unmatched query wizard to build a query to show the
records in tablea not in tableb and a second query to show the records in
TableB that are not in TableA.

You can't have the query return an error message.

If you are trying to do this in VBA you could use the DLookup function to
see if any one number existed in TableA and in TableB.

Sample query to find unmatched records in TableA:
SELECT TableA.*
FROM TableA Left Join TableB
ON TableA.NumberField = TableB.NumberField
WHERE TableB.NumberField is Null
 
Back
Top