Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Building a format Query

Status
Not open for further replies.

ferrisj

IS-IT--Management
Dec 7, 2004
79
US
I have phone numbers that do not have any mask on them. I am trying to write a query that would make Phone #, 5555555555 into 555-555-5555. I did this a long time ago, and remember the field looking something like:

UPDATEPHONE: ([Phone],3) & "-" & ([Phone],3) & "-" & ([Phone,4])

THis of course does not work. Can someone help me with this.
 
Why not simply this ?
UPDATEPHONE: Format([Phone], "000-000-0000")
Or this ?
UPDATEPHONE: Left([Phone],3) & "-" & Mid([Phone],4,3) & "-" & Right([Phone,4])


Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Hi,

Code:
Format([Phone], "000-000-0000")


Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top