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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert string to number

Status
Not open for further replies.

jvolden

IS-IT--Management
Jan 26, 2005
77
US
Does any one know of a way to convert a string to a number in Crystal reports 11. Is this possible?

Thank you
 
I would say with the ToNumber or CDbl functions. Of course, without seeing an example of the string in question, I'm just assuming that your string is comprised entirely of numbers.
 
the string is made up of numbers, periods and a comma. It is a version number for a definition library. We want to be able to say if table.deflib < table.currdef then. The currdef field is numeric and the deflib is a string. When I use the functions mentioned I receive a message stating the strin is non-numeric.
 
the string field deflib currently displays 3.21.345,423.
the currdef filed is 3.3.000,100.

I need the string field to be numeric so I can write a condition formula like this
if table.deflib < table.currdef
then
do something.

I can't do this right now because one field is numeric and the other is a string.
 
try this:

tonumber(replace(replace({table.deflib},".",""),",",""))

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top