Thanks to all, that worked.

----- Original Message -----
From: "Rommel Relosa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 05, 2001 6:39 PM
Subject: RE: IFEQ question


> Dave,
>
> I think Bill meant that:
>
> Instead of:  (t2.unit / t2.numclient)
> Use: (t2.unit / (IFEQ(t2.numclient,0,1,t2.numclient)))
>
> So your view would be like:
>
> DROP VIEW prodrept
>
> CREATE VIEW prodrept +
> (hhn,eid,sid,dserv,servcode,numcli,punits,svcid) +
> AS SELECT +
> t1.hhn, t2.eid, t2.sid, t2.dserv, t2.servcode, t2.numclient, +
> (IFEQ(t2.numclient, 0 , 0 , +
> (t2.unit / (IFEQ(t2.numclient,0,1,t2.numclient))))), t2.svcid +
> FROM yp t1, service t2 +
> WHERE t1.ypid = t2.ypid
>
>
>
> The (IFEQ(t2.numclient,0,1,t2.numclient))) can be called the "Division by
> zero eliminator".
> Gotta love those nested IFFY-Q's.
>
>
> Rommel
>
>  -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]  On
> Behalf Of Bill Downall
> Sent: Sunday, August 05, 2001 1:18 PM
> To: [EMAIL PROTECTED]
> Subject: Re: IFEQ question
>
> Dave,
>
> I think the innermost expression gets evaluated first.
>
> Instead of this:
>
> (IFEQ(t2.numclient, 0 , 0 ,(t2.unit / t2.numclient)))
>
> See if this works better:
>
> (t2.unit / (IFEQ(t2.numclient,0,1,t2.numclient))
>
> Bill
>
>
>
> On Sun, 5 Aug 2001 15:32:08 -0400, David Ebert wrote:
>
> >The IFEQ statement, if I understand it correctly, is supposed to
> exclude the
> >zero records (arg 4) because the numclient value (arg1) is not equal
> to zero
> >(arg2).
> >
>
>
>
>
>

Reply via email to