table comparison in Access 2000

  • Thread starter Thread starter vusubhashini
  • Start date Start date
V

vusubhashini

Hi All,
Hope some one will help me ASAP. I am using Access 2000. My problem
is.... i have 2 tables namely Table1 and Table2. I have to compare the
rows in both the tables. All the field names in both the tables are
same. if any of the column data changed, the complete row have to be
displayed.

i tried comparing all the colums like

SELECT Table1.* from Table1, Table2
Where table1.column1<>table2.column1 or table1.column2<>table2.column2

but the results are so much different what i expected.

Its so urgent. Appreciate ur help.

Thanks
 
Hi,

Indeed, a join with <> may surprise. Since you seems to look for a short
explanation, well, try:

SELECT Table1.*
FROM Table1 LEFT JOIN Table2
ON (table1.column1 = table2.column1) AND
(table1.column2=table2.column2)

WHERE table2.primaryKey IS NULL




It table2 has not primarykey, use one of its column that has no null,
initially.



Hoping it may help,
Vanderghast, Access MVP
 
Back
Top