Monday, March 24, 2014

Query-Split

this?



SELECT LEFT(STUFF(Code,1,PATINDEX('%[0-9]%',Code)+'1',''),
CHARINDEX('-',STUFF(Code,1,PATINDEX('%[0-9]%',Code),'')+'-')-1)
FROM Table





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


No comments:

Post a Comment