July 17, 2009 at 9:43 pm
Hi. I would like to add a problem that we have at work. Writing a query is not an option. The report we need to generate runs off a stored procedure, and we do not want to touch it. What I am looking for is a way to correctly format a phone number at runtime.
The source of the number does not control user input. Therefore the user could put in various characters either by accident or because he/she is used to a particular way of presenting phone numbers. So, the problem is twofold.
1. I need to strip the phone number of any non-numeric characters.
2. Present the phone number as (123) 456-7890
On the number 2, my solution is
="(" & Mid("1234567890",1,3) & ") " & Mid("1234567890",4,3) & "-" & Mid("1234567890",7,4)
I am left with the problem of how to strip the number of all non-numeric characters from within the textbox and/or table cell.
Any ideas would be greatly appreciated.
Thank you.
July 17, 2009 at 11:11 pm
tsmith (7/17/2009)
Hi. I would like to add a problem that we have at work. Writing a query is not an option. The report we need to generate runs off a stored procedure, and we do not want to touch it. What I am looking for is a way to correctly format a phone number at runtime.The source of the number does not control user input. Therefore the user could put in various characters either by accident or because he/she is used to a particular way of presenting phone numbers. So, the problem is twofold.
1. I need to strip the phone number of any non-numeric characters.
2. Present the phone number as (123) 456-7890
On the number 2, my solution is
="(" & Mid("1234567890",1,3) & ") " & Mid("1234567890",4,3) & "-" & Mid("1234567890",7,4)
I am left with the problem of how to strip the number of all non-numeric characters from within the textbox and/or table cell.
Any ideas would be greatly appreciated.
Thank you.
Double post... solution is at the following URL... please post any additional solutions there.
http://qa.sqlservercentral.com/Forums/Topic698934-338-1.aspx#bm755226
--Jeff Moden
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply