Change data format in a field?

R

retired fire

I currently have a phone number field which uses a format of 404-405-7777
and I want to change it to (404) 405-7777 format.

Can this be done and is there a way to globally change the format on
existing data in the phone field (large data base)???

Thanks
 
K

Ken Snell \(MVP\)

Are you storing the phone numbers right now as the xxx-xxx-xxxx value? If
yes, then you'd need to run an update query to change the data to the "new"
format.

If you're just storing the phone number as xxxxxxxxxx value, then you can
use the Format property to change how the number is displayed on forms and
reports.
 
F

fredg

I currently have a phone number field which uses a format of 404-405-7777
and I want to change it to (404) 405-7777 format.

Can this be done and is there a way to globally change the format on
existing data in the phone field (large data base)???

Thanks

Do ALL of the phone numbers include the area code and both dashes?
If the numbers are actually stored that way, as opposed to just how
they are formatted, then an Update query can be used to permanently
change the values:

Update YourTable set YourTable.Phone = "(" & Left([Phone],3) & ") " &
Right([Phone],8)

Then remember to change how new numbers are entered.
 
T

Tony Toews [MVP]

retired fire said:
I currently have a phone number field which uses a format of 404-405-7777
and I want to change it to (404) 405-7777 format.

Now you will never have international phone numbers right?

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
J

John Spencer

One method would be to use an update query where the update to value
would be

Format(Replace([PhoneNumber],"-",""),"\(@@@\) @@@\-@@@@")

And criteria of
Like "???[-]???[-]????"

'====================================================
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
'====================================================
 
A

ANNA MARIA

ok dear
Ï "Ken Snell (MVP) said:
Are you storing the phone numbers right now as the xxx-xxx-xxxx value? If
yes, then you'd need to run an update query to change the data to the
"new" format.

If you're just storing the phone number as xxxxxxxxxx value, then you can
use the Format property to change how the number is displayed on forms and
reports.
--

Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top