format telephone number

Alkaline

Registered User.
Local time
Today, 12:40
Joined
Sep 15, 2007
Messages
18
I need to format a telephone number so that the area code is at the end of the string. I'm not sure where the best place for this to be done. In the query or in the report? I can't do it in the table, as the data comes from a different database which I cant edit. I'm only concerned with having it show in the report. I know how to do such things in Forms, but have no clue how to create expressions for reports or queries.

Any help appreciated.
 
Since different coountries have different phone number patterns, what does your data in the table look like and how do you want it to look (use a specific example) and then we'll be able to help set you on your way.
 
Thanks for you reply. I have figured it how to do it now.

I created a new column in the query. In the Fieldname box of the new column I added the following

Phone: Mid([HomePhone],5,12)+" ("+Mid([HomePhone],1,3)+")"

'Phone' becomes the name of the column in the query. What this code does is it takes a phone number in the format 123-456-7890 and makes it 456-7890 (123)

[HomePhone] is of course the fieldname of the phonenumber column in my table. And so the report takes the data directly from the query, formatted and all.
 

Users who are viewing this thread

Back
Top Bottom