Hi Everyone,
I have a phone number coming from the database coming in the format of 2132563111. How can I do this in sql query
213-563-3111
Please let me know if there is any function that does it.
Thanks.
Data formatting is better handled on that front end. That being said, you could format the number using something like this:SELECTLEFT(phone,3) +'-' +SUBSTRING(phone,4,3) +'-' +SUBSTRING(phone,7,99)AS formattedPhonedFROM yourTable
No comments:
Post a Comment