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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing from csv and adding field to existing records 2

Status
Not open for further replies.

train2

Technical User
Mar 18, 2003
47
0
0
GB
Morning,
I initially imported a load of pupil records from a csv file into a database table. Now i've been told to include another field for each pupil. I can get this data into csv format, with primary key and the new field data, but how do I "append" this fielddata to the existing table? I think append is only used for new records, and this won't be the case - I'm just updating.

I really just want the new field to be added rather than rebuild the whole table as some data has been changed.

Is there any way of doing this? I've tried looking at help, my manual and these forums, but with no joy. Should I be looking at a 2-step way of importing into a new table and then running an update query?

I'd appreciate any help
jr
 
train2:

You are on the right track but the wrong query type.

First, add the new field to the table design of the existing table of data.

Create a query using both the existing table and the new table with the additional field making sure they are linked on the primary key. In the design grid, use only the new field from the existing table. Make the query type an update query and in the Update To cell reference the field on the new table that contains the information you want to add.

Use the '!' symbol on the tool bar to commit the changes.

Be sure to make a backup copy of the existing table just in case.

HTH

Larry De Laruelle
ldelaruelle@familychildrenscenter.org

 
Thanks Larry,
that all makes sense!
JR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top