By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,806 Members | 1,829 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,806 IT Pros & Developers. It's quick & easy.

Formatting phone numbers

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

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
Share this Question
Share on Google+
1 Reply

Expert 2.5K+
P: 2,878

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.