Results 1 to 3 of 3

Thread: Query (2002)

  1. #1
    New Lounger
    Join Date
    Jan 2006
    Location
    Walnut Creek, California, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Query (2002)

    I have two tables that contain similar data. I would like to update table 2 to contain records from table 1 that meet a criteria and are not in table 2. I can't figure out how to join to two table in a query to do this. Can anyone help
    Thanks

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

    Re: Query (2002)

    Say that both tables contain an ID field, and you want to append (add) records from tblTable1 to tblTable2 that don't have a matching ID value.
    - Create a query based on tblTable1.
    - Add all fields you need, including ID.
    - Set the criteria for ID to

    Not In (SELECT [ID] FROM [tblTable2])

    - Set additional criteria as needed.
    - Switch to datasheet view to check that the correct records are selected, then switch back to design view.
    - Select Query | Append Query.
    - Specify tblTable1 as the target table.
    - If necessary, adjust field names to be appended to.
    - Select Query | Run to execute the query.

  3. #3
    New Lounger
    Join Date
    Jan 2006
    Location
    Walnut Creek, California, USA
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Query (2002)

    Thanks, That did it.
    Ben <img src=/S/clapping.gif border=0 alt=clapping width=19 height=23>

Posting Permissions

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