Insert contents of Col in one table into another table

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello

Is it possible in Access to insert the contents of a column from one table into another table? When I run a Sql statement, it pretends to be inserting (or doing something - hourglass) and when I view the table, nothing has been done

This is my SQL statement

Insert into table
(col2
Select ColA from table2

What am I doing wrong

Any help you can give me will save me lots of grief!

Sandy
 
Hello:

Is it possible in Access to insert the contents of a column from one table into another table? When I run a Sql statement, it pretends to be inserting (or doing something - hourglass) and when I view the table, nothing has been done.

This is my SQL statement:

Insert into table1
(col2)
Select ColA from table2;

What am I doing wrong?

Any help you can give me will save me lots of grief!!

Sandy

An INSERT query creates *new records* in the target table. In this
case, if Table2 had 2000 records, the query would create 2000 new
records in Table1 - unless Table1 has required fields other than Col2.

If you want to put the value in ColA into the field Col2 in *existing*
records in Table1, you will need instead to use an UPDATE query,
joining the two tables on a unique field so that it is unambiguous
what record you're updating.

It appears that you may be using "spreadsheet logic" here - a sure and
certain way to get into trouble! What are these tables, and how are
they related? What actual data are you trying to transfer?
 
Hello, John

You are right - I was using "spreadsheet logic" - don't ask me why

Thanks for pointing that out

Sandy
 
Back
Top