
July 20th, 2007, 08:34 PM
|
|
Registered User
|
|
Join Date: Dec 2004
Posts: 9
Time spent in forums: 2 h 24 m 35 sec
Reputation Power: 0
|
|
|
Updating one table from another
Hi you wonderful helpers who generously give your time away to help the less competent
I thought this would be an easy task but I'm not an advanced SQL guy and don't know how to use an inner join, which apparently I need to use.
I have two tables
tblEmp
fname (nvarchar)
lname (nvarchar)
balance (money)
beginning_balances
fname (nvarchar)
lname (nvarchar)
balance (money)
I want to update the balances from beginning_balances to tblEmp.
Here's my attempt to recreate the example I was tyring to follow which yeilded zero results although I know that there are exact fname and lname matches:
Code:
Update tblemp
Set tblemp.balance = beginning_balances.balance
From tblemp
Inner Join beginning_balances
On tblemp.fname = beginning_balances.fname
And tblemp.lname = beginning_balances.lname
Where tblemp.balance = 0
Am I completely off here?
|