Phone number formatting

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a situation were I would like to be able to reformat the phone
number in a table. For example if my number looks like 5551234567
how can I update or reformat it to look like 555-123-4567 in the table? The
field is a text field.
Thanks!
 
Set its format to 000-000-0000

If you want the change to be permanent, you'll need to use an Update query
along the lines of

UPDATE MyTable
SET MyNewPhone = Format(MyOldPhone, "000-000-0000")
WHERE MyOldPhone IS NOT NULL

(note that I'm suggesting creating a new field in the table, just in case
something goes wrong!)
 
rockhound said:
I have a situation were I would like to be able to reformat the phone
number in a table. For example if my number looks like 5551234567
how can I update or reformat it to look like 555-123-4567 in the
table? The field is a text field.
Thanks!

I always use @@@ @@@-@@@@
this gives 555 123-1234 or just 555-1212.
If not you will have extra work to show
555-555-1212 and not show -555-1212
 
rockhound said:
I have a situation were I would like to be able to reformat the phone
number in a table.

No, you want to reformat the phone number in queries, forms and reports.
Tables are just buckets in which to store data, not view or edit it. :-)
 
Back
Top