Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 phone number extraction query needed

Author  Topic 

soorajtnpki
Posting Yak Master

231 Posts

Posted - 2008-07-30 : 02:35:01
hi all,
i want to fetch phone number from a field phone in table data.
sample data is as follows
phone required
(01) 245 491111 01245491111
012+ 45 491111 01245491111
012-45-491111 01245491111
012 45 491546456 01245491546456

but the phone number entered into this column has no validation.
so any charcters can be entered like 012-45dr491111
so in short what i need is only numbers from that column without any spaces

thanks in advance
ok...

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-07-30 : 02:46:27
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/12/18/extract-only-numbers-from-a-string.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

soorajtnpki
Posting Yak Master

231 Posts

Posted - 2008-07-30 : 03:06:57
hi madhivanan thanks for ur reply.

i need the query urgent.

i will be happy if u pls send that query in table-column format.

my query is as follows

select workno from customers where len(ltrim(rtrim(workno))) > 0

can u pls add phone number extraction with the above query


ok thanks...
Go to Top of Page
   

- Advertisement -