468,242 Members | 1,447 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

Formatting phone numbers

I have a phone Field where records vary with how they were entered with punctuations: examples:

2485551212
248.555.1212
248-555-1212
248 555 1212

along with a few others. I am looking for a script to write them all to the same format. preferable 248-555-1212 or no punctuation at all.

I'm not sure if I should do a replace script to remove the unwanted characters or if there is something that will delete all non numeric characters from the field and then do an input mask?
Sep 18 '08 #1
1 1199
ck9663
2,878 Expert 2GB
Try:

Expand|Select|Wrap|Line Numbers
  1. select replace(replace(replace(phone_number, '-',''),'.',''),' ','') from yourtable
-- CK
Sep 18 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

3 posts views Thread by Shay Hurley | last post: by
5 posts views Thread by joemono | last post: by
7 posts views Thread by ilona | last post: by
reply views Thread by KentEMon | last post: by
4 posts views Thread by Brian Henry | last post: by
2 posts views Thread by czbacnik | last post: by
reply views Thread by Blasting Cap | last post: by
5 posts views Thread by lim4801 | last post: by
4 posts views Thread by Blue Streak | last post: by
6 posts views Thread by Jack | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.