Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 Update From Multiple Tables

Author  Topic 

matt.orme
Starting Member

23 Posts

Posted - 2008-03-28 : 16:12:50
I have a mess:

First, I am using Access 2003.

Table1(T1) contains Column1 (C1) which must be appended to Column2 (C2) in Table2 (T2) where an identifying code column(ID) matches in each table. An example of what I want is, where T1.C1 = 'Aluminum' and T2.C2 = 'Material', I would like it to be updated to T2.C2 = 'Material: Aluminum'. I tried this:

UPDATE T2
SET T2.C2 =
(SELECT T1.C1
FROM T1
WHERE T1.ID = T2.ID) + ':' + T2.C2

This did not work out. How should I fix this?

TerryNL
Starting Member

21 Posts

Posted - 2008-03-31 : 07:23:09
maybe a stupid answer,
but can't you just change the content of table 1?
UPDATE T1
SET C1 = 'Material: ' + C1
Go to Top of Page

matt.orme
Starting Member

23 Posts

Posted - 2008-03-31 : 10:54:07
Got it figured. Thanks.
Go to Top of Page

TerryNL
Starting Member

21 Posts

Posted - 2008-04-01 : 08:46:59
your welcome
Go to Top of Page
   

- Advertisement -