TexanInParis
Registered User.
- Local time
- Today, 19:35
- Joined
- Sep 9, 2009
- Messages
- 112
You still need a "driver" table, but you can reload it each time you need to compare two tables.
First, create the "driver" table with these fields:
ID - AutoNumber
Main
From
To
SOS
Define a Unique key on Main, From, To, and SOS
Now each time you need to compare two tables, do this:
1) Delete all rows in the "driver" table.
2) Create a UNION query on the two tables:
SELECT Main, From, To, SOS
FROM Table1
UNION
SELECT Main, From, To, SOS
FROM Table2;
Note that the UNION will eliminate any duplicates.
3) Run an Append query into the "driver" table using the UNION query above as input. This will create a unique number for all the combinations of the four fields found in the two tables.
4) Add ID Long Integer to the two tables you're comparing.
5) Run an Update query that joins "driver" to the target table joined on the four key fields, and copy ID from the driver to the target. Do this for both target tables.
You now have matching unique IDs in both target tables and can use that to compare them.
First, create the "driver" table with these fields:
ID - AutoNumber
Main
From
To
SOS
Define a Unique key on Main, From, To, and SOS
Now each time you need to compare two tables, do this:
1) Delete all rows in the "driver" table.
2) Create a UNION query on the two tables:
SELECT Main, From, To, SOS
FROM Table1
UNION
SELECT Main, From, To, SOS
FROM Table2;
Note that the UNION will eliminate any duplicates.
3) Run an Append query into the "driver" table using the UNION query above as input. This will create a unique number for all the combinations of the four fields found in the two tables.
4) Add ID Long Integer to the two tables you're comparing.
5) Run an Update query that joins "driver" to the target table joined on the four key fields, and copy ID from the driver to the target. Do this for both target tables.
You now have matching unique IDs in both target tables and can use that to compare them.