all groups > sql server mseq > april 2004 >
You're in the

sql server mseq

group:

isnumber


isnumber Mehran
4/22/2004 5:43:34 AM
sql server mseq:
Hi!

Think that you have this string "1-345-456", is it=20
possible to check what is number in this string and how=20
can i remove those who isn=B4t a number

Thank you for helping me
Re: isnumber Vishal Parkar
4/23/2004 10:20:31 AM
hi mehran,

if you the unwanted characters that need to be removed from the string are
known then you can make use of "replace" function.

ex:
drop table multi_nos
CREATE TABLE multi_nos ( b varchar(50))

insert into multi_nos values ('++123-456-675')
insert into multi_nos values ('++12-456-75')

In this example i know that if i remove + and - then i will get the pure
numeric value, so i can write a query as:

select replace(replace(b, '-',''),'+','') 'b' from multi_nos

--Vishal


AddThis Social Bookmark Button