[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re: TRANSLATE function





I would try this:

Let $num1 = substr($phone_nbr,1,3)
Let $num2 = substr($phone_nbr,5,3)
Let $num3 = substr($phone_nbr,9,4)
Let $phonenbr = $num1 || $num2 || $num3



 (Embedded
 image moved   Sam Spritzer <SSpritzer@GW.CTG.COM>
 to file:      08/17/99 04:58 PM
 pic02968.pcx)




Please respond to SQR-USERS@list.iex.net

To:   Multiple recipients of list SQR-USERS <SQR-USERS@list.iex.net>
cc:    (bcc: Kimberly Blumenberg)
Subject:  TRANSLATE function




Has anyone had any luck in stripping off non-numerical characters from phone
numbers?

I have a phone number field that "normally" looks like ###/###-#### and needs to
be an all numerical field.  Normally, I would do
LET $phonenbr = TRANSLATE($phone_nbr,'/','')
LET $phonenbr = TRANSLATE($phone_nbr,'-','')

This seems like a roughneck way of coding and does not take into consideration
any other code that might slip through.

Sam

pic02968.pcx