User Profile

Collapse

Profile Sidebar

Collapse
m00nbeast
m00nbeast
Last Activity: Aug 26 '07, 08:20 PM
Joined: Jul 21 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • m00nbeast
    replied to Updating one table from another
    Yay, I accomplished my goal with help from someone:

    Code:
    UPDATE beginning_balances SET fname = rtrim(ltrim(fname))
    and then got the balance update finished with this:

    Code:
    UPDATE tblemp
    SET tblEmp.balance = b.balance
    FROM tblemp INNER JOIN 
    	(SELECT beginning_balances.fname, beginning_balances.lname, beginning_balances.balance FROM beginning_balances) AS b
    ON tblEmp.fname = b.fname AND
    ...
    See more | Go to post

    Leave a comment:


  • m00nbeast
    replied to Updating one table from another
    UGH! I just confirmed that all the fnames in beginning_balan ces have leading spaces in them! What's the quickest way to get rid of them? Change it in Excel somehow and then reimport? Create a new table and write to it while stripping out the leading spaces.... erm... somehow.
    See more | Go to post

    Leave a comment:


  • m00nbeast
    replied to Updating one table from another
    I apologize. I double checked and they are all nvarchar. I tried to change the OP to reflect this but the edit button is missing.

    Heres what I found out. I tried to even just get records to come back:

    Code:
    SELECT t.fname, t.lname, t.balance, b.fname, b.lname, b.balance
    FROM tblemp t
    INNER JOIN beginning_balances b
    ON t.fname = b.fname AND t.lname = b.lname
    but it returned nothing so I dug...
    See more | Go to post

    Leave a comment:


  • m00nbeast
    replied to Updating one table from another
    Actually every balance in tblemp is at zero so it is unnecessary. I should have left that out. sorry....
    See more | Go to post

    Leave a comment:


  • m00nbeast
    started a topic Updating one table from another

    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 (text)
    lname (text)
    balance (money)

    beginning_balan ces
    fname (text)
    lname (text)
    balance...
    See more | Go to post
No activity results to display
Show More
Working...