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

Update Query 2

Status
Not open for further replies.
Jul 14, 2003
116
CA
I am trying to write and update query where the 'newvalue' is the value in another table.

Ex.

Tbl1 Elements
- ID
- newVal

Tbl2 Elements
- ID
- updateVal

I am trying to write an update query where in Tble2 updateVal becomes newVal in Tbl1 matching on ID. Is it possible to write an update query in this way?
 
UPDATE Tbl1 INNER JOIN Tbl2 ON Tbl1.ID = Tbl2.ID
SET Tbl1.newVal = Tbl2.updateVal;

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top