Help Help Need to copy a field from one table into another table

Help Help Need to copy a field from one table into another table

Post by Leif Kjeldse » Fri, 11 Oct 2002 10:01:51



I know I need to use insert into and select
statement but not sure what the syntax is. I am aware of
that is should look something like this

Set db = OpenDatabase("a:\My_Database.mdb")
db.Execute "INSERT INTO Into_Record.Field(8) SELECT
From_Record.Field(x) FROM From_Record.Filed(y)"

pleaase give me an example of the code

 
 
 

Help Help Need to copy a field from one table into another table

Post by Luke Zhang [M » Tue, 15 Oct 2002 21:25:31


Your code wouldn't work. The "insert into" is intend to add new records to
a table, not a column. Try the "ALTER TABLE" command":

CREATE TABLE doc_exa ( column_a INT)
ALTER TABLE doc_exa ADD column_b VARCHAR(20) NULL

Luke

(This posting is provided "AS IS", with no warranties, and confers no
rights.)