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

String is Non-Numeric

Status
Not open for further replies.

JRN30

Programmer
Oct 23, 2003
7
0
0
US
I am new to this message board and have only worked with Crystal for a short time.

Question is this:
When I remove a flag from the selection criteria, which is {OEFCHEADER_1_NF.OECH_CM_FLAG} = 1.00 (it's a number field)to only show Invoice credits, it affects another formula field which is:
ToNumber (Mid ( ToText({OEFCHEADER_1_NF.OECH_INVOICE_DATE}, 0, ""), 5, 2))
With this formula, I am extracting the month out. I am getting an error saying the above string is Non-Numeric. If I put the selection criteria back in, it works fine.

Not sure if this is enough information...however if anyone has any suggestions, it would be greatly appreciated.
 
Hi,

Delete Tonumber from the formula and test run it and check for the result.

Mid ( ToText({OEFCHEADER_1_NF.OECH_INVOICE_DATE}, 0, ""), 5, 2)

There may be data error, one of the field values could be text. This way you can find the problem record and fix the value in database.

 
To get rid of the error, use the following:

if isnumeric(ToNumber (Mid ( ToText({OEFCHEADER_1_NF.OECH_INVOICE_DATE}, 0, ""), 5, 2))) then
ToNumber (Mid ( ToText({OEFCHEADER_1_NF.OECH_INVOICE_DATE}, 0, ""), 5, 2))
else
0

If you need this data to be accurate for your report, I'd create a real date field using a SQL Expression in Crystal and then yse a record selection formula to eliminate the offending rows from the result set and just use the MONTH() function against the SQL Expression returned date.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top