Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the Access database I have about 100 db records with the phone number in this format: 0000000000

I need to update the phone number format to: (000) 000-0000

Is there a quick way I could do this without changing each record manually? Is their a regular expression that could solve this problem?
Posted

1 solution

A simple update query and some string operations could solve your problem.

Ger all telephone numbers in a datatable and loop through the individual records.
Format all numbers using standard string operations like substring etc.

Update the table.

Just note that your phone number has to be of type varchar and not number.
If it is number, you will not be able to store formatted data.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900