Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Posts
    42

    Unanswered: Update and add to a table with another table

    Here is what I am trying to accomplish.

    I have a employee table that I will get an update for periodically.

    The number of records won't allways be the same in the update I receive.

    I will have a common ID accross the two tables.

    I will allways want to take what I have in the update and replace and or add to what I have in the master employee table.


    I think this is possible but i'm not sure how I should tackle it.


    Thanks

  2. #2
    Join Date
    Dec 2006
    Posts
    53
    Are the updates going to be field updates to current records, additional records, or both?

  3. #3
    Join Date
    Apr 2004
    Posts
    42
    Both.

    I will need to update the records based on changes like are they active anymore.

    Then I will need to add new employees.

  4. #4
    Join Date
    Dec 2006
    Posts
    53
    Well, adding new employees is easy. Simply run an append query and, assuming that you have a primary key assigned in the destination table, the duplicates will be "kicked out."

    I guess that to start with for the updates, you will need to have a way to know which records have been updated (a flag field or updated date field). Otherwise, you'd have to compare every field in every record, right? Not every record in the updating table will contain updated information, correct?

  5. #5
    Join Date
    Apr 2004
    Posts
    42
    I have come up with one solution.

    1st I am running an append query to get the changed records.

    2nd I am running an update query to get the new records.

    Thanks for the help.

Posting Permissions

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