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

Converting phone number questions

Status
Not open for further replies.

jmlbones

Technical User
Jul 16, 2001
13
US
I have phone numbers in a table as "(123) 456-7890" and I need to convert them to "123/456-7890" within a query. Can anyone help?
 
Use the MID, RIGHT, LEN, and INSTR functions.
Assuming the column with the phone number is called "phone":

SELECT
mid(phone, 2,3) & "/" &
right(phone, len(phone) - instr(phone, " "))
AS newphone
FROM YourTable;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top