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 statement help

Status
Not open for further replies.

nollieflip

Programmer
Joined
Aug 22, 2003
Messages
5
Location
US
I need to update a column that I did not originally populate on the first pass of my DTS script.

In my DTS I needed to combine our accountid's and account locations into one string. The problem now is how to write a update statement and the source data has the id's and locations still seperated...

Here is what I have, SQL tells mell "Invalid column name '0000'" (I needed to pad the right side of our account strings with 4 0's)

UPDATE BuildAccount
SET EmailAddress1 = (SELECT EmailStandards.EmailStandard
FROM EmailStandards WHERE BuildAccount.AccountNumber = EmailStandards.Account & right("0000" & EmailStandards.Location,4))
 
single quotes instead of double quotes around 0000, and + instead of & as the concatenation character

next time, try the sql server forum, forum183, as you will probably get a faster answer

rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top