Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Field to Numberic Value

Status
Not open for further replies.

TEM3

Technical User
Dec 6, 2004
324
US
Using Crystal Reports 8.5:

I have a mixed bag string field in an Oracle 9i table that I need to convert the records that are numeric into values. Most of the records are in the form "0.0123". Some have a "%" tacked onto the end. Some records are non-numeric, such as "Not Detected". I need to test for a numeric string and then, if so, convert it to a numeric value.
 
IF IsNumeric({fieldname})
THEN ToNumber({fieldname})
ELSE
0 (or whatever you want the default to be)
 
You can use the IsNumeric() function which returns true or false.

HTH

Gary Parker
MIS Data Analyst
Manchester, England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top