>>
Why do I get a divide by zero error on the following view:
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
<<

TO know if IFEQ is true, Rbase have to evaluated the function, and that's
why to have the problem ...

Try :

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 AND  t2.numclient <> 0

J.M. GRATIAS, Logimatique

Reply via email to