how to add in new field to a table

zhuanyi

Registered User.
Local time
Today, 15:15
Joined
Apr 24, 2007
Messages
66
Hello,
I have a table that has some fields and now i would like to append a table to it, mapping the same field and add in the field of the second table that the first one does not have, and leave the field blank for all data in the first field. may I know how can I possibly do this? thanks a lot!
 
You mean like you are importing data or permanently combining two tables?

Go into the design view for your first table and add the required fields.

Then write a query that links the two tables together by the common field and updates the new field.

So I we have the following two tables:

tblPersonDetail:
PersonID
Address

tblTelephone:
PersonID
TelNo

And you want to have tblPersonDetail to look like:
PersonID
Address
TelNo

Then add the TelNo field to tblPersonDetail.

Then run the following update query:

Code:
UPDATE tblPersonDetails INNER JOIN tblTelephone ON tblPersonDetails.PersonID=tblTelephone.PersonID SET tblPersonDetails.TelNo = tblTelephone.TelNo

If you are new to update queries then take a backup of your database until you are confident of what you are doing.

hth
Stopher
 

Users who are viewing this thread

Back
Top Bottom