ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Appending records from one table to another (https://www.excelbanter.com/excel-programming/284955-appending-records-one-table-another.html)

Mary Tate

Appending records from one table to another
 
Iam new at VB. I am in VB and using the VB data manager.
What would be the correct SQL statement to take all the
records from one table to append them to another table?
I have a dataset with 5 tables.

Any help would be GREATLY appreciated!

Mary

onedaywhen

Appending records from one table to another
 
INSERT INTO
MyMainTable
(Col1, Col2, Col3)
SELECT
ColA AS Col1, ColB AS Col2, ColC AS Col3
FROM
Table1
UNION
SELECT
ColX AS Col1, ColY AS Col2, ColZ AS Col3
FROM
Table2
UNION
...
FROM table5

--

"Mary Tate" wrote in message ...
Iam new at VB. I am in VB and using the VB data manager.
What would be the correct SQL statement to take all the
records from one table to append them to another table?
I have a dataset with 5 tables.

Any help would be GREATLY appreciated!

Mary



All times are GMT +1. The time now is 05:37 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com