Compare table with imported table and find differences (1 Viewer)

mac101

New member
Local time
Today, 15:34
Joined
Dec 9, 2019
Messages
2
I am wanting to regularly import a "staff" table to an access database and compare it to the current staff table in the database.

What I am hoping to achieve is to compare the current "staff" table with the imported "staff" table and find any differences. The imported table would hold the most up to date data. If there was a difference in any of the fields between the two tables, I would like the current staff table to be updated with the value in the imported table. Also, if there are any new records in the imported table, I would like these to be appended to the current table.

Even if the updates can't be done automatically, if the two tables could be compared to highlight any field(s) that are different and any new records, this would be a good starting point.

Does anyone have any suggestions on the best way to try and tackle this?

Thanks
 

bob fitz

AWF VIP
Local time
Today, 14:34
Joined
May 23, 2011
Messages
4,719
Perhaps you could start by using an "Unamatched" query to retrieve records that have differences.
 

isladogs

MVP / VIP
Local time
Today, 14:34
Joined
Jan 14, 2017
Messages
18,209
As Bob said use an unmatched query (there's a wizard for this) to determine any new records. You can convert that into an append query to add the new records.
Then use an update query to update fields to the new values.
If you need to remove old records that are no longer active, either deactivate them (recommended) or use a delete query (not usually a good idea as you may need that data in the future)

You may find this website article useful: Synchronise Data. It explains different ways of doing this process
 

mac101

New member
Local time
Today, 15:34
Joined
Dec 9, 2019
Messages
2
Thanks both for your replies. I have managed to to find the new records with unmatched query wizard. Will work through the examples in the link, thanks!
 

theDBguy

I’m here to help
Staff member
Local time
Today, 06:34
Joined
Oct 29, 2018
Messages
21,454
Thanks both for your replies. I have managed to to find the new records with unmatched query wizard. Will work through the examples in the link, thanks!
Hi Mac. Welcome to AWF! Good luck with your project.
 

isladogs

MVP / VIP
Local time
Today, 14:34
Joined
Jan 14, 2017
Messages
18,209
Glad to have helped. Do ask if you have any questions about the article in my link
 

Users who are viewing this thread

Top Bottom