Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: HELP: Division by Zero!
On Mon, 13 Mar 2000 16:51:14 -0500, "Abey Joseph" <abeyj_at_netzero.net> wrote:
>Our user wants to see a profit % also. My
>logic, ((PRICE-COST)/PRICE)*100 works great until it comes across a price of
>zero (0).
Hmmm.. Try the following:
DECODE(PRICE,0,0,((PRICE-COST)/PRICE)*100) If PRICE=0, the DECODE will return 0. Otherwise it will return the results of your formula.
Jonathan