What to do of balance columns?

B

Buti Bori

I have an excel file having 10 columns only. I have an existing table1 in
Access, having exactly similar data-types defined columns. When importing
from Excel, how can I ask Access to ignore the unoccupied, balance columns?
Or do I have to always import to a new Table? Importing in existing table
never happens. Thanks
 
J

John Nurick

You can create a new table linked to (or imported from) the Excel
sheet, and then use an append query to move the data into the correct
columns in the Access table.

Or you can use an append query that gets the data directly from Excel,
with syntax like this where AA, BB etc are the field names (or column
headers in Excel):

INSERT INTO table1
SELECT AA, BB, FF, HH
FROM [Excel 8.0;HDR=Yes;database=C:\MyBook.xls;].[Sheet1]
;

If the Excel data doesn't have a row of headers containing the field
names, use something like this (F1 is the first column and so on):

INSERT INTO table1 (AA, BB, CC, DD)
SELECT F1, F3, F5, F6
FROM [Excel 8.0;HDR=No;database=C:\MyBook.xls;].[Sheet1]
;
 

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