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!

Merging 2 tables

Status
Not open for further replies.

filterjon

Technical User
Dec 19, 2005
7
GB
Hello,

I want to merge 2 tables to simplify a database.

I wish to add into the first table some text from the 2nd table where an ID matches. But I don't want to append new rows or columns I wish to add the text into an existing text box on the record.

e.g>
Table 1
ID Name
1 Jon

Table 2
ID Surname
1 Lock

goes to

Table 1
ID Name
1 Jon Lock

Is this possible?

Thanks in advance. Jon
 
I would just do this in the query anytime I needed the information combined:

Code:
SELECT A.ID, A.Name & " " & B.Name
FROM Table1 A
INNER JOIN Table2 B ON A.ID = B.ID

If you really want to do the update then maybe something like:

Code:
UPDATE Table1 A INNER JOIN Table2 B ON A.ID = B.ID SET A.Name = A.Name & " " & B.Name

disclaimer: all queries typed not tested


Leslie

In an open world there's no need for windows and gates
 
Thanks Leslie - I will have a play with the set bit of the inner join.

p.s. I love your disclaimer!!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top