Update and Append data

ramserp

Board Regular
Joined
May 1, 2009
Messages
62
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
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
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).
 
Upvote 0
Thank you Joe

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

Regards
Ramesh
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,483
Members
448,967
Latest member
visheshkotha

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top