Page 1 of 1

error in query ORA-01476: divisor is equal to zero

Posted: Fri Jul 21, 2006 4:20 am
by mfa786
sir i user this query but system give me error

SELECT STUSECMTAMT.totdebit/STUSECMTAMT.totalcr,STUJOURNAL.cre_bal/(STUSECMTAMT.totdebit/STUSECMTAMT.totalcr) FROM STUSECMTAMT,STUDEG,STUJOURNAL WHERE STUSECMTAMT.vhno=STUJOURNAL.ref_no AND STUSECMTAMT.studegid=STUDEG.studegid;

error


ERROR at line 1:
ORA-01476: divisor is equal to zero


please give me idea

thank

aamir

Posted: Sat Nov 18, 2006 5:48 am
by ahmadbilal
nvl(colname,1) will solve your problem

Posted: Sat Nov 18, 2006 9:06 am
by admin
Zero devisor error comes when you are deviding with 0 like 25/0. The best way is to remove division "/" from the query and see the data and you will find zero's. thanks