Division by zero
Hi everybody,
I have this on my report:
Format of the Memo is number with ##,##0.## expression. Decimal separator-> .
I already tried:
But nothing work.
At runtime error is Invalid floating point, where the Memo have zero value.
What I'm doing wronge ??
Any help will be very appreciated.
I have this on my report:
[IIF(<DBDind1."pkgs"> > 0,(<DBDind1."dkgs">/<DBDind1."pkgs">)*100, 0)]
Format of the Memo is number with ##,##0.## expression. Decimal separator-> .
I already tried:
[IIF(<DBDind1."pkgs"> > '0',(<DBDind1."dkgs">/<DBDind1."pkgs">)*100, '0')]
IIF(<DBDind1."pkgs"> > 0.1,(<DBDind1."dkgs">/<DBDind1."pkgs">)*100, 0)]
But nothing work.
At runtime error is Invalid floating point, where the Memo have zero value.
What I'm doing wronge ??
Any help will be very appreciated.
Comments
My suggestion is that you do it with an OnBeforePrintEvent, split the factors into separate variables, and calculate all from script.
Something like
<!--fonto:Courier New--><span style="font-family:Courier New"><!--/fonto-->OnMemoBeforePrint();
a := <DBDind1."pkgs">
b:= <DBDind1."dkgs">
if a>0 then
memo.text := (b/a)*100
else
( ....)
<!--fontc--></span><!--/fontc-->
and so on
I hope it gives you some ideas,
I'm afraid I have not scripting in my Basic version ? [img]style_emoticons/<#EMO_DIR#>/unsure.gif" style="vertical-align:middle" emoid=":unsure:" border="0" alt="unsure.gif" /> However, I'll try to code some like you told me. Thank you very much.[/img]
But by using it you will turn on the nag messages, I believe.
Give it a quick try anyway