Hello everyone,
I am trying to divide one count by another. I have pasted the part of the query I am struggling with below (sorry about the confusing aliases).
count(distinct p.processno)/(select COUNT(distinct oa.noteid) as "Count"
from W2PROCESSdch Pab, upmfolder fab, w2objectnote oa, w2processtype ptab, w2stage sab
where fab.folderid = pab.keynumb
and trunc(Pab.STAGESTARTDATE) >= '07-SEP-11'
and trunc(Pab.STAGESTARTDATE) <= '07-SEP-11'
and pab.processname = ptab.proctypeid
and sab.stageid = pab.stageid
and oa.keynumb = pab.processno
and oa.notetype = 'RN'
and trunc(oa.ndate) = TRUNC(Pab.STAGESTARTDATE)
and UPPER(sab.caption) like UPPER('View Rejection%')
and p.userid = pab.userid)* 100
Unfortunately I get the error "01476. 00000 - "divisor is equal to zero"".
I have tried using CASE but that isn't working either.
I have tried searching for the solution but I have had no luck. If anyone could suggest how I should structure this part of the query I would be extremely grateful.