Copy records from one table to another

J

Jessica

I need to copy 182 records to another table that already has 84 records in
it. All the fields are the same for both tables. How can i do it?
 
D

Douglas J. Steele

Create an Append query.

Create a new query and add the table with 182 records to the query. Drag all
of the fields to the grid. Change the query to an Append query (how you do
this depends on what version of Access you're using), make sure that the
fields match, then run the query.
 
D

Dirk Goldgar

Jessica said:
I need to copy 182 records to another table that already has 84 records in
it. All the fields are the same for both tables. How can i do it?


You can easily create and run an append query to do this. If all the fields
are in the same order and there are no conflicting keys, you should be able
to use simple SQL like this:

INSERT INTO YourTargetTable
SELECT * FROM YourSourceTable

If the fields aren't in the same order, or if you have to omit some fields
(such as, for example, an autonumber primary key that may have conflicting
values), then your query has to specify the source and target fields. In
SQL it would look like this:

INSERT INTO YourTargetTable (Field1, Field2, Field3)
SELECT Field1, Field2, Field3 FROM YourSourceTable

It's a lot easier to build that sort of query in the Query Design View
window, because then Access will help you out with the field names. The key
is to set the query type to "Append Query".
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top