unmatched query

  • Thread starter Thread starter rneaul
  • Start date Start date
R

rneaul

I have two tables with approx 200 fields and 300 records each. One table is
older than the other. I would like to compare all 200 fields and create a
new table of only those items that have changed. I know I can write a
separate query for each field, but am hoping there is a way to only write
one. Does anyone have any ideas?

Thanks
 
Hi,


If you have a primary key that didn't changed, it can be something like:

SELECT a.*, b.pk
FROM a LEFT JOIN b ON a.pk=b.pk
WHERE b.pk IS NULL
OR a.f1 <> b.f1
OR a.f2 <> b.f2
OR ...
OR a.200 <> b.200



Note that you can't get more than 255 fields.




Hoping it may help,
Vanderghast, Access MVP
 
Back
Top