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

Error in Formula "Number is Required Here"

Status
Not open for further replies.
Sep 10, 2009
37
US
I have the below code:

If isnull({Command.missingdocs}) or {Command.missingdocs} ="" then 'NULL'
Else {Command.missingdocs}

What I am trying to do is have the formula display "Null" if the row is empty. The value of that field is a number there fore the error is saying I need a number where I have ""?

Any suggestions?

Thanks!
 
Try
Code:
If isnull({Command.missingdocs}) or {Command.missingdocs} = 0 then 'NULL'
Else ToText({Command.missingdocs})
I assume the field is numeric.

It helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options. In this case, it probably makes no difference.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Great! That works, but now the value is coming back with 2 decimal places (2.00)? I tried converting it tonumber, but that doesn't work. Also I am using version 11.

Thanks!
 
If isnull({Command.missingdocs}) or
{Command.missingdocs} = 0 then 'NULL'
Else ToText({Command.missingdocs},0,"")

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top