Wednesday, March 28, 2012

remove character from string

Hi I am filling a table with a select statement and one of the columns
(Time1data)returned from the select statement looks like 10:30, it is a
character type. The table I am trying to put it in is expecting 1030 and is
character 4 type. Just wondering if anyone knows how to remove the : as par
t
of the select statement?
I tried select Right (Time1data,4) but this just gets the right 4 characters
.
Thanks.
--
Paul G
Software engineer.Hi Paul,
You can use REPLACE, like this:
SELECT REPLACE(Time1data, ':', '')
FROM ...
HTH,
Plamen Ratchev
http://www.SQLStudio.com|||It worked! thanks.
--
Paul G
Software engineer.
"Plamen Ratchev" wrote:

> Hi Paul,
> You can use REPLACE, like this:
> SELECT REPLACE(Time1data, ':', '')
> FROM ...
> HTH,
> Plamen Ratchev
> http://www.SQLStudio.com

No comments:

Post a Comment