kutti45
SSC Enthusiast
Points: 104
More actions
October 7, 2009 at 12:53 am
#138547
i have table column in sql server like this
dat1/dat2/dat3/dat4/1/2009
dat1/dat2/dat34/dat4/2/2009
dat1/dat2/dat/sd34/dat4/3/2009
ssf/sdf/sdf/sf/sf/sf/4/2009
i want the number alone in that column like this
1
2
3
4
please give me the solution
arun.sas
SSChampion
Points: 11831
October 7, 2009 at 1:12 am
#1062607
declare @result varchar(50)
set @result = 'dat1/dat2/dat/sd34/dat4/3/2009'
select @result = replace(right(@result,6),'/2009','')
select @result
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply