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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding brackets and dashes to a string 1

Status
Not open for further replies.

AZgolfer1

Technical User
Jun 17, 2008
5
US
Hello,
Does anyone know how to add brackets and dashes to a string representative of the area code and phone number? The string has all the numbers combined and I would like to add brackets around the area code and then add a dash in the phone number.

Thanks,
 
The easy way is to set the input mask property for the text box to phone number
 
How are ya AZgolfer1 . . .

For existing numbers an update query should do!

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
How are ya AZgolfer1 . . .

For existing numbers an Update Query should do! . . .

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
If you do need an UPDATE query for existing data, try something like this.

Code:
UPDATE tPhoneNumbers
SET PhoneNumber = "(" + LEFT(phoneNumber,3) +")" + " " + MID(PhoneNumber,4,3) + "-" + MID(PhoneNumber,6,4);
 
Thanks to both of you. I have fixed the issue.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top