Link to home
Start Free TrialLog in
Avatar of bdoshuk
bdoshuk

asked on

Crystal Reports Formula Error 'A Number is Required Here'

Hi, I'm trying to construct a very simple formula in Crystal Reports that will only display the value if it is greater than zero. This is the formula I have: -
If {Client.Units} <> 0 then {Clients.Units} else ""
I get 'A number is required here' error.
Have tried this too: -
If {Clients.Units} = 0 then "" else {Clients.Units}
For this I get a 'String is Required Here' error!
I'm sure this is very simple to resolve but I'm relatively new to Crystal and any help would be greatly appreciated.
Thanks in advance.
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Becuase {Clients.Units} is a number, the "else" clause must also return a number.

If you are trying to suppress this field if zero, you should use a number format instead.

Place the {Clients.Units} on the report, right click and select Format Field
Click on the number tab and then customize button.

put a Check in suppress if zero.

Avatar of bdoshuk
bdoshuk

ASKER

Many thanks!