Results 1 to 2 of 2
  1. #1
    afinch300 is offline Novice
    Windows 7 64bit Access 2013 64bit
    Join Date
    Aug 2018
    Posts
    1

    Comparing Fields in Two Tables and Showing Differences (SQL Except)

    Hi,



    Wonder if anyone can help, really stuck on this one and can't seem to work my way out of it even with reading many threads online,

    I want to be able to take a table which is populated with imported data and compare it to the table of data that already exists within the database.

    I want to be able to highlight with a query which records are different in the uploaded data to that of the existing data, I managed to get this to work in SQL using the except function however I am not able to use a web app for this project and have to use MS Access (not a problem, just can't seem to get the except functionality to work in Access).

    Any ideas??

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    I presume both tables share the same PK so you can link on them. In which case your query would be something like

    SELECT * FROM
    TableA INNER JOIN TableB on TableA.PK=TableB.PK
    WHERE TableA.fld1<>TableB.fld1 OR TableA.fld2<>TableB.fld2 OR TableA.fld3<>TableB.fld3 OR....etc

    If you have more than 9 fields (PK excepted, no point in comparing that), you will need to build in the sql window as the query grid only has space for 9 criteria rows

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

Similar Threads

  1. Replies: 1
    Last Post: 10-04-2016, 02:42 AM
  2. Replies: 2
    Last Post: 11-25-2015, 08:03 PM
  3. Replies: 7
    Last Post: 07-07-2014, 02:39 PM
  4. Comparing 2 fields on 2 different tables
    By ericxmiller in forum Queries
    Replies: 9
    Last Post: 03-15-2013, 02:25 PM
  5. Compare tables and tell me differences
    By cowboy in forum Programming
    Replies: 2
    Last Post: 08-11-2010, 08:32 AM

Tags for this Thread

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