David
Do you get the error when you just do the select?
Is ZERO set ON or OFF?
What are the datatypes of the columns unit and numclient?
David Blocker
----- Original Message -----
From: "David Ebert" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, August 05, 2001 3:32 PM
Subject: IFEQ question
> Why do I get a divide by zero error on the following view:
>
> 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 / t2.numclient))), t2.svcid +
> FROM yp t1, service t2 WHERE t1.ypid = t2.ypid
>
> RETURN
>
> 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).
>
> What all of this is trying to accomplish is to give me a way of reporting
on
> a staff members units of productivity divided by the number of clients.
> Some contacts may not involve the client directly (i.e., phone
consultation
> with other agencies) so the numclient is = 0. Others (groups) may involve
> multiple clients so that if you sum the units for a staff member you get
12
> hours of productivity reported for a one-hour group of six clients.
>
> Thanks,
>
> Dave Ebert
> [EMAIL PROTECTED]
>
>
>