August 26, 2011 at 12:40 am
i have a string '12345676'
i want convert it into following format
123-4567-6
plz help me out
August 26, 2011 at 12:48 am
YES
August 26, 2011 at 12:51 am
Something like this?
declare @String VARCHAR(15)= '12345676'
select @String = STUFF(STUFF(@String,4,0,'-') ,9,0,'-')
select @String
August 26, 2011 at 4:09 am
thanx its working 🙂
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply