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

String to Number Syntax Question 2

Status
Not open for further replies.

entertel

Programmer
Apr 1, 2008
6
US
Hi Tek-Tips!

I'm having a problem with the ToNumber syntax.
I'm using Crystal 8.5

ToNumber ({IM1_InventoryMasterfile.Weight}) * Sum ({IM5_TransactionDetail.TransactionQty})

The Weight field is a string and I just want to convert it to numeric so I can multiply it by the Quantity

The result is this "The String is non-numeric"
If I remove the ToNumber, I get "a number or currency amount is required here"

Can you please help me, I really appreciate it! Thank You, Lisa

 
What are the contents of the string? You might try trimming it first to get rid of spaces:

ToNumber(Trim({YourField}))

Or you might try the val() function

Val({YourField})

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
If that's not it, could it be {IM5_TransactionDetail.TransactionQty} that's not numeric?

[yinyang] Madawc Williams (East Anglia, UK). Using Windows XP & Crystal 10 [yinyang]
 
Try placing the weight field in the detail section and use a record selection formula of:

not isnumeric({IM1_InventoryMasterfile.Weight})

Then report back with the results.

-LB
 
Sorry to jump in on this thread, but I am having the exact issue (also Crystal 8.5). When I put in the formula

not isnumeric({eqlists.Venue_addr3})

I get FALSE for any record that has a number and TRUE for any record that is null or has alpha or alpha and numeric characters in the field.
 
Hi,
That is the correct result ( a number is numeric and your formula, to be true, cannot reference a number)..
If you mean it does not work, be sure you have it as a Record Selection formula.



[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top