Saturday, February 25, 2012

Removing character from varchar

Hello all,
How would you remove the last character from the following string:
jmy0084t?
Thanks
JonJon wrote:
> Hello all,
> How would you remove the last character from the following string:
> jmy0084t?
> Thanks
> Jon
>
select left('jmy0084t',len('jmy0084t')-1)|||Hi
Such as
DECLARE @.str varchar(10)
SET @.str = 'jmy0084t?'
SELECT @.str,LEFT(@.str,LEN(@.str)-1),STUFF(@.str,LEN(@.str),1,'')
John
"Jon" wrote:
> Hello all,
> How would you remove the last character from the following string:
> jmy0084t?
> Thanks
> Jon
>

No comments:

Post a Comment