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

the string is non numeric 2

Status
Not open for further replies.

Pandal

Technical User
Oct 6, 2003
39
CA
error the string is non numeric
Please be patient with me I'm a novice at this

crystal 8 Oracle database
Each field (8 of them) below are observations for a sewer manhole inspection
each one is populated by numbers
I created this formula below called @Size which totals all 8 perfectly
(tonumber({INSMHI.HYCVRS}) + tonumber({INSMHI.HYFRAMES} ) + tonumber( {INSMHI.HYRINGSS}) + tonumber({INSMHI.HYCONES})
+ tonumber({INSMHI.HYWALLS}) + tonumber({INSMHI.HYBENCHS}) + tonumber({INSMHI.HYCHNLS}) + tonumber({INSMHI.HYBASES} ))

My Problem is when I sort or try and create a group on the formula I get the error stated above
Any suggestions or better way of doing this would be awesome , not to mention getting my boss off my back :)
thanks in advance
 
I'm guessing that somewhere in your report you have a null or a blank field, so you might try using:

(if isnull({INSMHI.HYCVRS}) or
trim({INSMHI.HYCVRS}) = "" then 0 else
tonumber({INSMHI.HYCVRS})) +
(if isnull({INSMHI.HYFRAMES}) or
trim({INSMHI.HYFRAMES}) = "" then 0 else
tonumber({INSMHI.HYFRAMES})) + //etc.

Make sure that you do not have "convert null values to default checked" in report options.

-LB
 
Hi Lbass
thanks for the reply
I created
(if isnull({INSMHI.HYCVRS}) or
trim({INSMHI.HYCVRS}) = "" then 0 else
tonumber({INSMHI.HYCVRS})) +
(if isnull({INSMHI.HYFRAMES}) or
trim({INSMHI.HYFRAMES}) = "" then 0 else
tonumber({INSMHI.HYFRAMES})) + (if isnull({INSMHI.HYRINGSS}) or
trim({INSMHI.HYRINGSS}) = "" then 0 else
tonumber({INSMHI.HYRINGSS})) +
(if isnull({INSMHI.HYCONES}) or
trim({INSMHI.HYCONES}) = "" then 0 else
tonumber({INSMHI.HYCONES})) + (if isnull({INSMHI.HYWALLS}) or
trim({INSMHI.HYWALLS}) = "" then 0 else
tonumber({INSMHI.HYWALLS})) +
(if isnull({INSMHI.HYBENCHS}) or
trim({INSMHI.HYBENCHS}) = "" then 0 else
tonumber({INSMHI.HYBENCHS})) + (if isnull({INSMHI.HYCHNLS}) or
trim({INSMHI.HYCHNLS}) = "" then 0 else
tonumber({INSMHI.HYCHNLS})) +
(if isnull({INSMHI.HYBASES}) or
trim({INSMHI.HYBASES}) = "" then 0 else
tonumber({INSMHI.HYBASES}))


This does get the total of the 8 fields but when I try and sort by the formula it still says "the string is non-numeric" and then wont let me out of the Formula Editor

 
Are you sure that each field is numeric? Maybe try adding another clause to each section:

(
if isnull({INSMHI.HYCVRS}) or
not (isnumeric({INSMHI.HYCVRS})) or
trim({INSMHI.HYCVRS}) = "" then 0 else
tonumber({INSMHI.HYCVRS})
)+ //etc.

-LB


 
If you don't care about nulls, then select the convert null values to default under options and do away with 2 lines of each clause.

The error being returned is likely as LB's last post suggests, you have non-numeric characters in there, so just use:

(
if not (isnumeric({INSMHI.HYCVRS})) then
0
else
tonumnber({INSMHI.HYCVRS})
)
+
...

-k
 
Thanks for your posts
I'm giving it a try now
 
That was it thank you both for your time
I tried the last post by synapsevampire
worked perfectly

Got to love Tek-Tips

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top