Results 1 to 4 of 4
  1. #1
    punna111 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    16

    Question Findout Unmatched rows without unique value

    Hi All,

    I have Table1 as below:

    Inv_No. Amt
    555 100
    555 50
    555 200
    555 50
    555 300
    555 50
    555 50



    and Below is the Table 2

    Inv_No. Amt
    555 50
    555 200
    555 50

    I would like to find out Unmatched rows, as like below:

    Inv_No. Amt
    555 100
    555 300
    555 50
    555 50

    Can any help me to get the above unmatched rows
    Thanks in advance

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Do an Unmatched Query, but matching on two fields instead of one.
    Code:
    SELECT Table1.[Inv_No], Table1.[Amt]
    FROM Table1
    LEFT JOIN Table2
    ON Table1.[Inv_No]=Table2.[Inv_No] AND Table1.[Amt]=Table2.[Amt]
    WHERE Table2.[Inv_No] Is Null;

  3. #3
    punna111 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Aug 2014
    Posts
    16
    Hi JoeM,

    Thanks you for reply..

    But I am getting the result as below. any more help please..

    Inv_No Amt
    555 100
    555 300

  4. #4
    CJ_London is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,411
    you need something more in your data - inv 555, amt 50 appears a number of times in your tables so all match. The something needs to be a unique value of some sort. Even then I'm not sure you can do it

    databases have no sense of order so you cannot say 'the first 555/50 in table2 matches to the first 555/50 in table1 and the second to the second and that leaves the 3rd and 4th unmatched'

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

Similar Threads

  1. Replies: 3
    Last Post: 06-30-2014, 12:53 AM
  2. Replies: 1
    Last Post: 07-30-2013, 02:19 PM
  3. Replies: 1
    Last Post: 05-15-2012, 05:05 PM
  4. Replies: 3
    Last Post: 05-15-2011, 08:40 AM
  5. Unmatched with multiple columns and rows
    By sampson20 in forum Programming
    Replies: 1
    Last Post: 04-18-2011, 10:48 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