User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the MS SQL section within the Web Development category of DaniWeb, a massive community of 402,904 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,121 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our MS SQL advertiser: Programming Forums
Views: 869 | Replies: 0
Reply
Join Date: Jul 2006
Posts: 4
Reputation: m00nbeast is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
m00nbeast m00nbeast is offline Offline
Newbie Poster

Updating one table from another

  #1  
Jul 20th, 2007
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 (text)
lname (text)
balance (money)
beginning_balances
fname (text)
lname (text)
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:
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?
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb MS SQL Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the MS SQL Forum

All times are GMT -4. The time now is 3:24 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC