Question : Compare 2 fields from 2 different tables

I would like to run a simple query to compare 2 fields from 2 different tables in the same access 97 database.  These tables are related by a serial number.  What is the proper syntax to list all records that don't have matching fields.  Here is the action I would like to perform.

Display all records whith the following criteria; Field 1 in the table1 does not equal field 1 in table2.

Answer : Compare 2 fields from 2 different tables

Hello JAMES125,

You may want to try this query instead:

SELECT "Table1" AS Source, t1.*
FROM Table1 t1 LEFT JOIN
      Table2 t2 ON t1.Field1 = t2.Field1
WHERE t2.Field1 Is Null
UNION ALL
SELECT "Table2" AS Source, t2.*
FROM Table1 t1 RIGHT JOIN
      Table2 t2 ON t1.Field1 = t2.Field1
WHERE t1.Field1 Is Null

Regards,

Patrick
Random Solutions  
 
programming4us programming4us