Page 1 of 1

Numeric check & conversion

Posted: Tue Jun 22, 2010 11:11 pm
by nani0907
Hi,

If a value in a column is not a numeric ,i need to convert it to Sting 'NULL' .How can we implement this is effective way.mysource is csv file.

Please advice

Posted: Wed Jun 23, 2010 1:03 am
by ray.wurlod
Depends. What is your definition of "numeric"? Does it include all of the following?
24
17.32
-8.92
6.023E23
-1.551E-15

You can use an appropriate testing function, perhaps Num() to determine whether the string (note, not "sting") is numeric based on your rules, within an If..Then..Else construct, and use SetNull() to generate the null if required.

Posted: Wed Jun 23, 2010 6:33 am
by chulett
As noted, it depends on both what you consider to be "numeric" and the nature of the data to be checked. Can you be more specific? Post some examples of both "good" and "bad" data in the field.