Telephone Numbers

M

MB

I'm not sure if this is a query question or a reports question. I have a
database where the table has an input mask to include the area code for the
telephone numbers. The report (based on a query) shows the telephone
numbers, but I'm wondering if there is a way that the report will result with
just the local number (excluding the area code) because we have reports that
all are in the same area code.

I tried changing the input mask on the properties of the field in the report
design, but that didn't work. What do I need to do?

Working with Access 2003.

Thank you!
 
J

John Spencer

You could use MID or Right functions to truncate the phone number. ASS-U-Me
that your phone numbers are always formatted the same way.

For instance
(410) 876-1234
Then you want everything from the seventh character on.

Field: NoArea: MID([PhoneNumberField], 7)

If they are formatted as
410.876.1234
then you want everything from the fifth character on
Field: NoArea: MID([PhoneNumberField], 5)


--
John Spencer
Access MVP 2002-2005, 2007
Center for Health Program Development and Management
University of Maryland Baltimore County
..
 
J

Jerry Whittle

Assuming that all your telephone numbers have area codes and assuming that
the characters like () and - are stored in the table:
LocalPhones: Right([HomePhone],8)

No dash stored:
LocalPhones: Right([HomePhone],7)

Some with and without area code:
LocalPhones: Mid([HomePhone],Len([HomePhone])-7)
 

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

Top