Results 1 to 3 of 3

Update and Append data

This is a discussion on Update and Append data within the Microsoft Access forums, part of the Question Forums category; Hi All, I have 2 tables(A and B) with following columns: ID Ticket Number (Primary Key) Type of Ticket Priority ...

  1. #1
    Board Regular
    Join Date
    May 2009
    Location
    Bangalore, India
    Posts
    62

    Default Update and Append data

    Hi All,

    I have 2 tables(A and B) with following columns:

    ID
    Ticket Number (Primary Key)
    Type of Ticket
    Priority
    Actual Start
    Actual Finish Date
    Status
    Hours
    Worklog
    AssignedTo

    I want to copy data from table A to table B. While copying data if there is any existing ticket number then I need to update the record and if the record is new then i need append.

    Please help me on how to write both append and update quiries in the same query.

    Thanks
    Ramesh Katta

  2. #2
    MrExcel MVP
    Moderator
    Joe4's Avatar
    Join Date
    Aug 2002
    Posts
    27,252

    Default Re: Update and Append data

    The Append Query is pretty easy. Just do an Unmatched Query between the two tables (joining on the Ticket Number field). This will show you all the records in one table that aren't in the other. Then just change the query from a Select query to an Append query.

    For the Update query, you just want an Inner Join between the two tables (to return all the records that match). Then change to an Update query and decide which records you are going to update.

    I would recommend reading up on Action queries (specifically Update and Append) in the Access help files for more specific details. There are also some tutorials and articles on-line that you can find using a Google search.

    Give it a shot, and if you run into specifc issues, post back here, along with your code (if you change your query to SQL view, you can copy and paste your code here).
    TIPS FOR FINDING EXCEL SOLUTIONS
    1. Use the built-in Help that comes with Excel/Access
    2. Use the Search functionality on this board
    3. A lot of VBA code can be acquired by using the Macro Recorder.

    "Give a man a fish, feed him for a day. Teach a man to fish, feed him for life!"

  3. #3
    Board Regular
    Join Date
    May 2009
    Location
    Bangalore, India
    Posts
    62

    Default Re: Update and Append data

    Thank you Joe

    I will try on the way you have told and reply back If I get any doubts.

    Regards
    Ramesh

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com