Home Forums SQL Server 2005 Administering extact last 3 characters from a string RE: extact last 3 characters from a string
SALIM ALI
Right there with Babe
Points: 799
More actions
October 14, 2009 at 4:44 am
#1065578
how about...
DECLARE @string VARCHAR(20)
SELECT @string = 'ABC DEFGH'
select @string = replace(@string,' ','')
select @string = substring ( @string, 1,(len(@string)-3)) + ' ' +
substring ( @string, (len(@string)-2),3 )
select @string