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

Help with creating update query

Status
Not open for further replies.

dmoonme

MIS
Jul 21, 2004
33
US
Hi, I'm a newbie at this but here's what I want to do.

TableA has columns: ServerName,Drive,Last_Free
TableB has columns: ServerName,Drive,LastPercentFree

I import new data into TableA weekly. The old data is stored into TableB. The problem is that I want to update the Last_Free column in TableA with TableB's column LastPercentFree. The servername and drive data frequently change so I want to only update TableA.Last_Free where servername and drive in TableA and TableB match.

PLEASE HELP! Thanks!
 
Something like this ?
UPDATE TableA INNER JOIN TableB ON (TableA.ServerName=TableB.ServerName AND TableA.Drive=TableB.Drive)
SET TableA.Last_Free=TableB.LastPercentFree

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

Part and Inventory Search

Sponsor

Back
Top