By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,639 Members | 2,276 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,639 IT Pros & Developers. It's quick & easy.

Remove ( and ) and -

P: n/a
Sam
Could someone help me by providing a formula that will change the
formatting, in a query of a phone number.. The data in the table is
formatted as (123) 456-7890. I need the field to be 123456789 without
changing the actual table.

Any help would be appreciated
Sep 24 '08 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Wed, 24 Sep 2008 10:21:47 -0700 (PDT), Sam wrote:
Could someone help me by providing a formula that will change the
formatting, in a query of a phone number.. The data in the table is
formatted as (123) 456-7890. I need the field to be 123456789 without
changing the actual table.

Any help would be appreciated
exp: Replace(Replace(Replace(Replace([Phone],"(",""),")",""),"-",""),"
","")
Sep 24 '08 #2

P: n/a
On Wed, 24 Sep 2008 11:38:10 -0700, fredg wrote:
On Wed, 24 Sep 2008 10:21:47 -0700 (PDT), Sam wrote:
>Could someone help me by providing a formula that will change the
formatting, in a query of a phone number.. The data in the table is
formatted as (123) 456-7890. I need the field to be 123456789 without
changing the actual table.

Any help would be appreciated

exp: Replace(Replace(Replace(Replace([Phone],"(",""),")",""),"-",""),"
","")
Sorry, I didn't mean to not sign the reply.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 24 '08 #3

P: n/a
Sam
On Sep 24, 2:13*pm, fredg <fgutk...@example.invalidwrote:
On Wed, 24 Sep 2008 11:38:10 -0700, fredg wrote:
On Wed, 24 Sep 2008 10:21:47 -0700 (PDT), Sam wrote:
Could someone help me by providing a formula that will change the
formatting, in a query of a phone number.. The data in the table is
formatted as (123) 456-7890. *I need the field to be 123456789 without
changing the actual table.
Any help would be appreciated
exp: Replace(Replace(Replace(Replace([Phone],"(",""),")",""),"-",""),"
","")

Sorry, I didn't mean to not sign the reply.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Thanks Fred, this works except now I have the issue that if the phone
number field is blank I am getting a #Error I tried adding an iif
statement but I can not get the blanks to be blanks.

Any suggestions?
Sam

Sep 25 '08 #4

P: n/a
On Thu, 25 Sep 2008 05:39:04 -0700 (PDT), Sam wrote:
On Sep 24, 2:13*pm, fredg <fgutk...@example.invalidwrote:
>On Wed, 24 Sep 2008 11:38:10 -0700, fredg wrote:
>>On Wed, 24 Sep 2008 10:21:47 -0700 (PDT), Sam wrote:
>>>Could someone help me by providing a formula that will change the
formatting, in a query of a phone number.. The data in the table is
formatted as (123) 456-7890. *I need the field to be 123456789 without
changing the actual table.
>>>Any help would be appreciated
>>exp: Replace(Replace(Replace(Replace([Phone],"(",""),")",""),"-",""),"
","")

Sorry, I didn't mean to not sign the reply.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Thanks Fred, this works except now I have the issue that if the phone
number field is blank I am getting a #Error I tried adding an iif
statement but I can not get the blanks to be blanks.

Any suggestions?
Sam
In your query, as criteria on the [Phone] field column, write:

Is Not Null

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Sep 25 '08 #5

This discussion thread is closed

Replies have been disabled for this discussion.