importing columns from excel

D

DC Gringo

Using the importing wizard, I'm trying to bring in an Excel spreadsheet.
I'm not finding any way to map the import column for column and the wizard
ends in failure with no options...please help!

_____
DCG
 
J

John Nurick

Among the options:

1) ensure that column headings in the worksheet range match the field
names in the table you're importing to.

2) temporarily link or import the worksheet (using the wizard) and then
use an append query to map fields and do any necessary type conversions.

3) forget about the wizard and write the SQL statement for an append
query to move the data from the worksheet into your table. The syntax is
like this:

With column headings, import from specified range:
INSERT INTO MyTable
SELECT Column1 As Field1, Column2 As Field3, Column3 As Field2
FROM [Excel 8.0;HDR=Yes;database=C:\MyWorkbook.xls;].[Sheet1$A1:C999]
;

Without column headings, import from named range
INSERT INTO MyExistingTable
SELECT F1 As Field1, F2 As Field3, F3 As Field2
FROM [Excel 8.0;HDR=No;database=C:\MyWorkbook.xls;].[MyRange]
;
 

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