Results 1 to 4 of 4
  1. #1
    kentck86 is offline Novice
    Windows 8 Access 2007
    Join Date
    Jun 2015
    Posts
    13

    How to Compare and return with inconsistent field as results

    Hi Guys,

    I wanted to make a queries that could do the following to compare data field between Data Table No.1 & Data Table No.2 and then it will return with the results of Inconsistent Field ONLY as a New Table.

    Data Table No.1

    RncId version N302 N304 N308 T313 T314 ipAddress
    205 RN7.0 7 2 2 3 5 10.233.18.3
    206 RN7.0 7 2 2 3 5 10.233.18.67
    207 RN7.0 7 2 2 3 5 10.233.18.131
    208 RN7.0 7 2 2 3 5 10.233.19.3
    404 RN7.0 7 2 2 3 5 10.233.70.3

    Data Table No.2

    RncId version N302 N304 N308 T313 T314 ipAddress
    205 RN7.0 7 2 2 3 5 10.233.18.3
    206 RN7.0 7 2 2 3 5 10.233.18.67
    207 RN9.0 8 4 3 4 6 10.233.18.131
    208 RN7.0 7 2 2 3 5 10.233.19.3
    404 RN7.0 7 2 2 3 5 10.233.70.3


    Results Table:
    RncId version N302 N304 N308 T313 T314 ipAddress
    207 RN7.0 Change RN9.0 7 Change 8 2 Change 4 2 Change 3 3 Change 4 5 Change 6


  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    queries are not Inconsistent, they will always be consistent in the result.
    not sure what you mean.
    do you mean , show the changes between tabl1 and 2?

    in a query join the common field.
    compare each field,
    iif(fld1.n302<> tbl2.n302, "change","")

  3. #3
    kentck86 is offline Novice
    Windows 8 Access 2007
    Join Date
    Jun 2015
    Posts
    13
    Quote Originally Posted by ranman256 View Post
    queries are not Inconsistent, they will always be consistent in the result.
    not sure what you mean.
    do you mean , show the changes between tabl1 and 2?

    in a query join the common field.
    compare each field,
    iif(fld1.n302<> tbl2.n302, "change","")
    Hi ranman,

    Yes, i wanted to shows changes between table 1 and table 2 ONLY. Those without changes it should not shows results.

    thank you

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Try

    Code:
    SELECT Table1.RncID, Table1.version & " Change " & table2.version AS VersionChange, Table1.N302 & " Change " & table2.N302 AS N302Change,....
    FROM Table1 INNER JOIN Table2 ON Table1.RncID=Table2.RncID
    WHERE (table1.version<>table2.version) OR (table1.N302<>table2.N302) OR....
    you can complete the dots for the other fields

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

Similar Threads

  1. Inconsistent results.. please help!
    By vikghai in forum Access
    Replies: 6
    Last Post: 02-09-2014, 05:37 PM
  2. Replies: 1
    Last Post: 09-01-2012, 06:58 AM
  3. Replies: 7
    Last Post: 05-31-2012, 11:19 AM
  4. Replies: 9
    Last Post: 03-09-2012, 02:55 PM
  5. Replies: 2
    Last Post: 06-03-2011, 04: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