Duplicate validation of two identical tables

  • Thread starter Thread starter Matt Price
  • Start date Start date
M

Matt Price

Could someone email me a solution or suggestion for the
following issue:

I'm an epidemiologist and have been collecting patient
data using Access 2000. In a single database, I have two
initially identical tables. In these, two technicians
enter patient data with a unique number identifying each
patient. I want to compare these two tables for
typographical errors, how do I create a query that
compares the two tables (by unique patient number) and
creates a list of all the fields/variables that are
discrepant so that the technicians can go back to the
patient files (the hardcopies) to see which entry is
correct. Any thoughts? Please contact me at
(e-mail address removed).

Thank you,
Matt
 
Hi



SELECT PatientID
FROM ( SELECT PatientID, field2, field3, field4, ..., fieldZ FROM table1
UNION
SELECT PatientID, field2, field3, field4, ..., fieldZ FROM
table2 )
GROUP BY PatientID
HAVING COUNT(*) <> 1


.... since UNION will remove repeated records (UNION ALL would not).



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top