Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Export from excel into two tables

Status
Not open for further replies.

evergreean43

Technical User
May 25, 2006
165
US
I need to export about 3000 records (lines) of Excel into an Access 2000 database. The data needs to go into 2 tables.

Please advise if this is possible and how to do it?
 
You seem to be starting from the wrong point of view. Think of importing the Excel data into Access. To do this open the Access database in a design mode. Select File from the menu add then Get external. Your choices then will be Link Tables or Import. Make a choice and follow the prompts.
 
I tried the import from Access to grab Excel:
Excel 2000 info (shortened to show example):
Code:
City       State     Name    Age
Miami     Florida    Jones    34
Atlanta   Georgia  Smith    56
Dallas     Texas    Baker    43

I need to export it to an Access 2000 database. I have no problem with the Import utility in Access:
File/Get External Data/Import and I grab the data.
But that puts it in one table.

I need to put it in two tables:

Code:
TableOne
Id   City   State
1    Miami    Florida
2    Atlanta  Georgia
3    Dallas   Texas

TableTwo
Id   Name   Age
1    Jones   34
2    Smith   56
3    Baker   43

Please advise.
 
ok, take the table that import from excel makes and then run two insert queries:

INSERT INTO Table1 (SELECT City, State FROM ExcelTempTable)

INSERT INTO Table2 (SELECT Name, Age FROM ExcelTempTable)



Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for anyone working with databases:
The Fundamentals of Relational Database Design
Understanding SQL Joi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top