anumoses
asked on
oracle report summary column error -
I get an error- divisor is equal to zero.
The code is
------------------
function CF_4Formula return Number is
begin
return(:cs_1/:cs_sites);
end;
screen-print.JPG
The code is
------------------
function CF_4Formula return Number is
begin
return(:cs_1/:cs_sites);
end;
screen-print.JPG
ASKER
We cannot use decode in reports function. I had tried earlier
screen.JPG
screen.JPG
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Again though, you never answered what you want the result to be?
If you want say -1 or -999 returned, that is different logic.
If you want say -1 or -999 returned, that is different logic.
ASKER
never negative value. Its either 0 or > 0
>>never negative value. Its either 0 or > 0
you misunderstaood what I said: If cs_sites is ZERO, what value do you want returned from the function?
you misunderstaood what I said: If cs_sites is ZERO, what value do you want returned from the function?
ASKER
thanks
ASKER
Oh ok I want to return 0
>>Oh ok I want to return 0
function CF_4Formula return Number is
begin
if :cs_sites = 0 then
return(0)
else
return(:cs_1/:cs_sites);
end if;
end;
function CF_4Formula return Number is
begin
if :cs_sites = 0 then
return(0)
else
return(:cs_1/:cs_sites);
end if;
end;
What do you want to be the result it cs_sites is 0? you can return cs_1 with something like:
return(:cs_1/decode(cs_sit