UPDATE multiple records with multiple sources?

graedus

Registered User.
Local time
Today, 20:29
Joined
Feb 21, 2003
Messages
11
Hi,

Firstly, thank you all for the help you've offered me so far. That said:

I'd like to essentially run an UPDATE on every record in the table, altering each with different data.

For instance, I have one table (Table1) with Field1, Field2, and Field3.

On the table I'm updating (Table2), I'd like to change Table2.Field3 to Table1.Field3 where Table2.Field1 = Table1.Field1 And Table2.Field2 = Table1.Field2.

I can do this very easily with VBA, but is there a way to do it thourgh a query?

Thank you.
 
Last edited:
UPDATE tblTabl1e, tblTable2 SET tblTabel2.Field3 = tblTabel1.Field3
WHERE tblTable1.Field1=tblTable2.Field1
And tblTable1.Field2=tblTable2.Field2
;

RV
 
The syntax is:

Update Table1 Inner Join Table2 ON (table1.fld1 = table2.fld1) and (table1.fld2 = table2.fld2) SET table2.fld3 = table1.fld3;
 
Thank you very much, that's precisely what I needed. Thank you!
 

Users who are viewing this thread

Back
Top Bottom