Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Telephone number format in Query

4,389 views
Skip to first unread message

Kevin D.

unread,
Feb 26, 2009, 10:04:11 AM2/26/09
to
Hi All,

I have a query based on a table with a telephone number field that stores
the number thusly: 9993333333. I'd like the query to display the phone
number as such: (999) 333-3333. How can I do this?

Thanks for your help.

Kevin D.

Jerry Whittle

unread,
Feb 26, 2009, 11:51:05 AM2/26/09
to
Put this in the field of a query with the proper field name between the [ ].

TheTelephone: Format([TheTelephoneNumberField],"(@@@) @@@-@@@@")
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.

Marshall Barton

unread,
Feb 27, 2009, 9:19:56 AM2/27/09
to
Kevin D. wrote:
>I have a query based on a table with a telephone number field that stores
>the number thusly: 9993333333. I'd like the query to display the phone
>number as such: (999) 333-3333. How can I do this?


Assuming the field is a Text field, set the format property
of whatever is used to display (a form/report text box) the
phone number to:

(@@@) @@@-@@@@

--
Marsh
MVP [MS Access]

John Spencer MVP

unread,
Apr 7, 2009, 3:10:38 PM4/7/09
to
You are missing the call to the format function.

Business Phone: Format([Business Phone],"(###) ###-####")

Although you probably want

Business Phone: Format([Business Phone],"(@@@) @@@-@@@@")

And that can still cause errors, so you might need

Business Phone: Format([YOUR TABLE NAME].[Business Phone],"(@@@) @@@-@@@@")

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

samiauthor wrote:
> Hello Jerry, I tried to do what you suggested here for the other post, but
> still have a problem with it. This is what I have:
> Business Phone: ([Business Phone],"(###) ###-####")
>
> Can you please tell me what I'm missing?
> Thank you, Sharon
> vcis...@comcast.net

samiauthor

unread,
Apr 7, 2009, 3:46:04 PM4/7/09
to
That did the trick, thank you.

"samiauthor" wrote:

> Hello Jerry, I tried to do what you suggested here for the other post, but
> still have a problem with it. This is what I have:
> Business Phone: ([Business Phone],"(###) ###-####")
>
> Can you please tell me what I'm missing?
> Thank you, Sharon
> vcis...@comcast.net
>
> "Jerry Whittle" wrote:
>

mauro...@gmail.com

unread,
Feb 3, 2014, 10:43:56 PM2/3/14
to
Thanks for posting guys, I was able to update my records as well. :)
0 new messages