Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Find unmatched fields (Access 2000)

    Can somebody help me with an sql for finding unmatched fields? I cannot use for the time being the find unmatched query wizard since
    this is not installed in my computer. I want to find only those products for which the two fields called grosspirce
    in both tables do not match.:

    My query is the following :

    SELECT products.Productid, products.grade, products.grossprice, products1.grossprice
    FROM products INNER JOIN products1 ON products.Productid = products1.Productid;

    Thank you in advance

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: Find unmatched fields (Access 2000)

    I assume you meant GrossPrice, not GrossPirce. You can add Where Products.GrossPrice <> Products1.GrossPrice:

    SELECT products.Productid, products.grade, products.grossprice, products1.grossprice
    FROM products INNER JOIN products1 ON products.Productid = products1.Productid
    WHERE Products.GrossPrice <> Products1.GrossPrice;

    This will only return records where GrossPrice is filled in on both sides, but with different values. If you also want to catch records where GrossPrice is filled in on one side and blank on the other side, use:

    SELECT products.Productid, products.grade, products.grossprice, products1.grossprice
    FROM products INNER JOIN products1 ON products.Productid = products1.Productid
    WHERE (Products.GrossPrice <> Products1.GrossPrice) Or (Products.GrossPrice Is Not Null AND Products1.GrossPrice Is Null) Or (Products.GrossPrice Is Null AND Products1.GrossPrice Is Not Null);

  3. #3
    3 Star Lounger
    Join Date
    Jan 2001
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Find unmatched fields (Access 2000)

    Thank you !! I wish you a good day

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •