To have numbers only in a phone number column.
Moderators: chulett, rschirm, roy
To have numbers only in a phone number column.
Please let me know how we have only numbers for a phonenumber column.
For Example: (304)-645-7865
I just to get the number as 3046457865 .To be more simple, I want only numbers from 0-9 in the phone number column. Eliminate ( ), [], Ext,- etc...
For Example: (304)-645-7865
I just to get the number as 3046457865 .To be more simple, I want only numbers from 0-9 in the phone number column. Eliminate ( ), [], Ext,- etc...
On the Server side you have the DIGITS transform but on the PX side I'd just fall back on Convert, I do believe:
Something much like that.
Code: Select all
Convert("()[]-. ","",YourField)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 246
- Joined: Mon Jun 30, 2008 3:22 am
- Location: New York
- Contact:
OK. If you are expecting complete crap in your phone numbers then the old "double convert" trick may be in order:saraswati wrote:I don't what all non-numeric characters might come so it will be better if we can have some transformation so that it contains only numbers from 0-9.
Code: Select all
Convert(Convert("0123456789","",YourField),"",YourField)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Premium Member
- Posts: 62
- Joined: Tue Dec 07, 2004 7:41 am
- Location: Brasil
- Contact:
Yes, it is. I was quite impressed the first time I saw this posted as it wasn't something that had occured to me to do. Basically, the first convert removes all of the characters you want to keep from your string, generating a custom list of all of the unwanted characters in that particular value and that output is used in the next convert to remove them.max.madsen wrote:The solution its very interesting..
![Cool 8)](./images/smilies/icon_cool.gif)
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
-
- Participant
- Posts: 527
- Joined: Thu Apr 19, 2007 1:25 am
- Location: Melbourne