Comparing Two Linked Tables for Inaccuracies

  • Thread starter Thread starter David C
  • Start date Start date
D

David C

Hi Everyone,

I have 2 linked tables in Access from a MS SQL db. Both
are from different databases.

Table 1 will be joined to Table 2 by Customer_Id, Title_Id
and Issue_Id.

What I want to do is compare both tables to see if there
are any rows missing from table 2 that are in table 1.

Also I need to find out if the values in the numerical
columns in Table 2 are different from Table 1. I.e.

What do you all think is the best way to do this?

Cheers
 
2 Queries should do. Something like:

* Records in Table1 but NOT in Table2:

SELECT T1.*
FROM T1 Left Join T2
ON T1.Customer_Id = T2.Customer_Id
AND T1.Title_Id = T2.Title_Id
AND T1.Issue_Id = T2.Issue_Id
WHERE T2.Customer_Id Is Null

* Field values:

SELECT T1.*, T2.*
FROM T1 Left Join T2
ON T1.Customer_Id = T2.Customer_Id
AND T1.Title_Id = T2.Title_Id
AND T1.Issue_Id = T2.Issue_Id
WHERE T1.[NumField1] <> T2.[NumField1]
OR T1.[NumField2] <> T2.[NumField2]
.....
 
Back
Top