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

Update Query

Status
Not open for further replies.

vlitim

Programmer
Sep 2, 2000
393
GB
Completely lost my mind how do I do this??

first table
AID ATDVID inputvalue
8 16 Age NULL
8 10 Area NULL
8 11 GPS Ref NULL
8 6 Length NULL
8 15 Material NULL
8 7 Width NULL

second table
AID ATDVID inputValue
8 10 2550
8 6 20
8 7 10
8 15 2

I need to update the first tables "inputValue" with the corresponding inputValue from table 2 where AID and ATDVID match.

Cheers
Tim
 
See if this works for you..

Code:
Update [First Table]
SET	inputValue = st.inputvalue
FROM [First Table] ft 
JOIN [Second Table] st
on      ft.aid = st.aid
and     ft.atdvid = st.atdvid
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top