comparing tables in Access

Discussion in 'OT Technology' started by YUENGLING, Aug 16, 2005.

  1. YUENGLING

    YUENGLING New Member

    Joined:
    Jul 25, 2002
    Messages:
    231
    Likes Received:
    0
    Location:
    Pottsville
    Hello All,

    I'm still in the learnig stage using Microsoft Access 2003

    The issue I'm having is this:

    I have 2 tables

    1. Master

    2. Scanned

    Master contains 3 fields (ID, UPC, Price) Basically the Master table is a table that contains all UPC's and accosiated prices for a store.

    The Scanned tabled contains 2 fields (ID, and Scanned_UPC) Basically the scanned table is a table that represents all items with a UPC in the store.

    I want to do a query to compare all the items under the "Scanned_UPC" field in the Scanned table against the "UPC" field in the master table.

    And give me a result with the "UPC" and the "Price" in a third table.

    I appreciate any help... I'm all confused by this.
     
  2. Keyzs

    Keyzs OT Supporter

    Joined:
    Nov 3, 2003
    Messages:
    814
    Likes Received:
    0
    Location:
    Charlotte, MI
    SELECT Scanned.Scanned_UPC, Master.Price
    FROM Scanned
    INNER JOIN Master
    ON Scanned.Scanned_UPC = Master.UPC

    Guess, I am not all that great with SQL syntax without having the tables...
     
    Last edited: Aug 16, 2005
  3. Keyzs

    Keyzs OT Supporter

    Joined:
    Nov 3, 2003
    Messages:
    814
    Likes Received:
    0
    Location:
    Charlotte, MI
    Oh yea inserting into third table

    INSERT INTO table3
    (UPC, Price)
    SELECT Scanned.Scanned_UPC, Master.Price
    FROM Scanned
    INNER JOIN Master
    ON Scanned.Scanned_UPC = Master.UPC

    Again, untested and syntax maybe off... But you get the idea.
     

Share This Page