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

name trimming--help!!

Status
Not open for further replies.

Mbroad

Programmer
Feb 26, 2004
49
US
Hi--I have a 36 character NAME field on TABLE-1 (containing first and last name)

I need to separate the first-name & last-name from NAME writing them to TABLE-2 FNAME and LNAME fields

the "sticking "point is that I can only use the first 15 characters of each first or last name

I am not sure how or IF this can be done.
Please advise,
thanks,
Mark

Government Coder Mark
 
Use CHARINDEX and SUBSTRING to split the field appart (there are several examples in the forums on this). Then use LEFT (or SUBSTRING again) to ensure that the names are only 15 characters max.

Denny
MCSA (2003) / MCDBA (SQL 2000) / MCTS (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top