Results 1 to 4 of 4
  1. #1
    Plan B is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2011
    Posts
    4

    Question How to Compare, Flag, Update two tables?


    I am trying to figure out an easy way to compare two tables and make updates, flag, etc all in one shot if possible. What I have is Table_A which is a list of assets I have to do annual or bi-annual inspections on. These assets have an AssetID that is assigned from our GIS database. Periodically these assets get taken out of service or new assets are put into service. So every few months I need to export our active asset list (we can call this Table_B) from our GIS and compare it to Table_A in the access database. I would like to create an Active/Inactive field in Table_A to flag those assets that have been removed from the GIS (Table_B). Then add any new assets from the GIS (Table_B) and add/append them to Table_A. Any ideas would be appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Is your GIS database an ESRI personal geodatabase?

    I think you will have to do two find unmatched queries. One to find records in A not in B. You would want to update the unmatched records in A as inactive. The other to find records in B not in A. The unmatched records would then need to be appended to A.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Plan B is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Jul 2011
    Posts
    4
    Yes, it is an ESRI personal geodatabase.

    So I have two queries working, one that shows records in A not in B; and one that shows records in B and not in A.

    Now, what would be the best way to flag them as active/inactive? Can you do that with an update or append query?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Use UPDATE with the 'in A not in B'.

    Use INSERT SELECT with the 'in B not in A'.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Compare two tables and show it in a form
    By Jim.H. in forum Access
    Replies: 1
    Last Post: 01-25-2012, 08:51 PM
  2. Compare records in 2 tables
    By RalphJ in forum Access
    Replies: 13
    Last Post: 03-06-2011, 07:43 AM
  3. Compare tables and tell me differences
    By cowboy in forum Programming
    Replies: 2
    Last Post: 08-11-2010, 08:32 AM
  4. Compare two tables
    By Igli in forum Access
    Replies: 2
    Last Post: 07-05-2010, 10:30 AM
  5. Multi-select listbox and update flag in table
    By Suresh in forum Programming
    Replies: 0
    Last Post: 12-19-2007, 01:04 AM

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