Monday, August 4, 2014

substring

Can you try?



select
right(cast('00012300454' as int),2)



create table test
(
number varchar(20))

insert into test values('057740500'),('0410104'),('087219602'),('0020190'),('0077853')

select
right(cast(number as int),2) from test


select
cast(number as int),right(cast(number as int),2) from test





--Prashanth





No comments:

Post a Comment