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

Parse and Update 1

Status
Not open for further replies.

dvannoy

MIS
May 4, 2001
2,765
US
I have a field called name. I'm trying to take both the first and last name from the full name field and put them into seperate field called firstname and lastname.

UPDATE TEST

SET LASTNAME = PARSENAME(REPLACE(NAME, ', ',), 2),
SET FIRSTNAME = PARSENAME)REPLACE(NAME, ', ',),1)

getting error message 'incorrect syntax near ')'

any help would be appreciated

 
Code:
UPDATE TEST
SET    LASTNAME  = PARSENAME(REPLACE(NAME, ', ','.'),2),
       FIRSTNAME = PARSENAME(REPLACE(NAME, ', ','.'),1)

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Okay,

Now I'm getting 'Incorrect syntax near the keyword set'

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top