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!

Code to isolate the 4,5and 6 digit in phone number 1

Status
Not open for further replies.

noslo

Programmer
Dec 10, 2001
24
0
0
US
Hello All,

Please bear with my basic request. I am new to SQL Server.

I am trying to create a column from a phone number column.
I am trying to isolate the 4, 5 and 6th digit in a phone number.
Ex:[PhoneNumber] = 3135551212 New Column = 555

What code would I use?

Thanks for your patience and help.

Helen
 
Try that:

SELECT substring(PhoneNumber, 4, 3) FROM your_table

Shoud do what you need it to do

smg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top