Hi Friends,
How to handle Divide by Zero in CRN
For Eg,
I have a expression A/B
Do I need to use code like this
If
(B=0)
then (0)
else
(A/B)
Or
Just use A/B and CRN will take care of the Divide by Zero
My main concern here do we need to hardcode inform CRN to take care or CRN is going to take care of Divide By Zero even if we didn't take care of it.
TIA
Sudha
Hello Sudha,
I have deleted your very same post in Powerplay area.
You don't have to post the same question in multiple parts of the forum to get an answer more quickly, unless it was a mistake.
Have you tried your question by yourself in ReportNet ??
What was the result ?
First of all Posting in various places it was a Mistake, thanks for deleting it there becus I tried to Delete muself but could not.
Well when I tried this ...in 1 case
When I just write just A/B in the and run the Report I don't get anyout the whole Report was blank after running for a while.
So have to try the 2nd one with If-Then-Else statement and see...still going on
But I still need al valuable suggestions
Thanks
check the option in the query .....
Srik
by default when you divide one expression with another, reportnet internally uses the decode function (in oracle or its equivalent on other databases) to substitute the dividend (denominator) with a null if it is zero. This avoids division by zero errors. However a null is the result.
Little reminder: close the topic if it's been solved/closed (see board rules)
No not yet