Change Phone# Format

  • Thread starter Thread starter JamesJ
  • Start date Start date
J

JamesJ

Hi. I imported over 200 contacts into my Contacts table. The imported
data's phone number format is: (###) ###-####. I want to change it to:
###-###-####. Can someone please show me an update query to
change this format so I don't need to do each individual record?

Thanks,
James
 
Hi. I imported over 200 contacts into my Contacts table. The imported
data's phone number format is: (###) ###-####. I want to change it to:
###-###-####. Can someone please show me an update query to
change this format so I don't need to do each individual record?

Thanks,
James

You can use the Mid() function to extract the pieces. Try updating to
(test this first and back up your database!!!):

Mid([Phone], 2, 3) & "-" & Right([Phone], 8)

or (maybe better) store just the digits:

Mid([phone], 2, 3) & Mid([phone], 7, 3) & Right([phone], 4)

and introduce the - with an Input Mask or Format property.

John W. Vinson[MVP]
 
I forgot to mention that the field type is Text. Should I change it to
Number??

James

John Vinson said:
Hi. I imported over 200 contacts into my Contacts table. The imported
data's phone number format is: (###) ###-####. I want to change it to:
###-###-####. Can someone please show me an update query to
change this format so I don't need to do each individual record?

Thanks,
James

You can use the Mid() function to extract the pieces. Try updating to
(test this first and back up your database!!!):

Mid([Phone], 2, 3) & "-" & Right([Phone], 8)

or (maybe better) store just the digits:

Mid([phone], 2, 3) & Mid([phone], 7, 3) & Right([phone], 4)

and introduce the - with an Input Mask or Format property.

John W. Vinson[MVP]
 
No, keep the Text format.
--

Ken Snell
<MS ACCESS MVP>

JamesJ said:
I forgot to mention that the field type is Text. Should I change it to
Number??

James

John Vinson said:
Hi. I imported over 200 contacts into my Contacts table. The imported
data's phone number format is: (###) ###-####. I want to change it to:
###-###-####. Can someone please show me an update query to
change this format so I don't need to do each individual record?

Thanks,
James

You can use the Mid() function to extract the pieces. Try updating to
(test this first and back up your database!!!):

Mid([Phone], 2, 3) & "-" & Right([Phone], 8)

or (maybe better) store just the digits:

Mid([phone], 2, 3) & Mid([phone], 7, 3) & Right([phone], 4)

and introduce the - with an Input Mask or Format property.

John W. Vinson[MVP]
 
The problem I'm having with the Input mask is that
I view my contacts in a list box and even though the
data shows ###-###-#### the list box displays it as
##########.

James

Ken Snell said:
No, keep the Text format.
--

Ken Snell
<MS ACCESS MVP>

JamesJ said:
I forgot to mention that the field type is Text. Should I change it to
Number??

James

John Vinson said:
Hi. I imported over 200 contacts into my Contacts table. The imported
data's phone number format is: (###) ###-####. I want to change it to:
###-###-####. Can someone please show me an update query to
change this format so I don't need to do each individual record?

Thanks,
James


You can use the Mid() function to extract the pieces. Try updating to
(test this first and back up your database!!!):

Mid([Phone], 2, 3) & "-" & Right([Phone], 8)

or (maybe better) store just the digits:

Mid([phone], 2, 3) & Mid([phone], 7, 3) & Right([phone], 4)

and introduce the - with an Input Mask or Format property.

John W. Vinson[MVP]
 
The problem I'm having with the Input mask is that
I view my contacts in a list box and even though the
data shows ###-###-#### the list box displays it as
##########.

Use the Format() property in the listbox:

@@@-@@@-@@@@

John W. Vinson[MVP]
 

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

Back
Top