Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: HELP: Division by Zero!

Re: HELP: Division by Zero!

From: Jonathan Gennick <jonathan_at_gennick.com>
Date: 2000/03/14
Message-ID: <38d19e83.18535702@netnews.worldnet.att.net>#1/1

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



jonathan_at_gennick.com
http://gennick.com
Brighten the Corner Where You Are Received on Tue Mar 14 2000 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US