Results 1 to 3 of 3
  1. #1
    johnrohan is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2017
    Posts
    15

    How to merge two identical tables when data would conflict?

    This forum has been very helpful to me before, so I'm coming to you again.




    OK, here's our situation. There's more to this story, but I'll simplify it as much as possible.

    We have a large database with thousands of records that we update daily. Due to a server crash, the data and our backups were lost. We still had a copy of the database itself, just with no data in it.

    Over a period of days, the IT folks were trying to retrieve all the company data from the server. Meanwhile, we still had to do our jobs. So during those days we were waiting, we used our database shell and started entering new records there. When we had to update records entered prior to the crash, we just put in the record number and just filled out the fields that changed, and left everything else blank, planning to reconcile it all later.

    Now we have the old database back. So what to do?

    With the brand new records that were created since the crash, that's easy. They all have new record numbers assigned to them. I can just copy and paste them into the old table that we were using.

    With the records that had been created previously, that is more tricky, because now we essentially have duplicate record numbers with different data. We could have someone put the old and new data side by side, and manually copy and paste anything that needs to be updated, but that will take a long time, and that person would probably miss things. I was wondering if anyone knew of a way to merge tables, and whenever there is a conflict between identical records (defined by the record number), to use the most recent data and overwrite the old data?

  2. #2
    aytee111 is offline Competent At Times
    Windows 10 Access 2013 64bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    Assuming the correct primary key field - you call it record number - was entered, you can do a straight update query by joining the two tables on the PK record number and updating the old with the new. Additional records can be inserted to the table by using an append query based on unmatched records.

  3. #3
    johnrohan is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2017
    Posts
    15
    That seems to be the solution. Thank you!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Merge Data Tables
    By topcat10 in forum Queries
    Replies: 8
    Last Post: 08-07-2015, 12:24 PM
  2. Replies: 3
    Last Post: 07-24-2015, 06:39 AM
  3. Identical tables for different user data.
    By Bajaz001 in forum Forms
    Replies: 1
    Last Post: 03-15-2011, 10:37 PM
  4. Mail Merge w/ data from 2 tables
    By sedain121 in forum Import/Export Data
    Replies: 3
    Last Post: 06-30-2010, 09:43 AM
  5. Difference between 2 identical tables.
    By leepan2008 in forum Access
    Replies: 1
    Last Post: 09-28-2009, 07:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums