Issue with Maximo KPI Returning "0" Instead of a Calculated %
I'll add an answer since I believe you can improve the efficiency of your query by doing 1 scan instead of 2:

select 1.0*count(case when ACTFINISH &lt; TARGCOMPDATE then wonum end) 
     / count(wonum) 
from workorder 
where (status = 'CLOSE' or status = 'COMP') 
  and (woclass = 'WORKORDER' or woclass = 'ACTIVITY')
  and upper(crewid) = '17D02' 
  and istask = 0 
  and siteid = 'INDPLS' 
  and worktype = 'PM' 
  and (targcompdate &gt;= dateadd(month,datediff(month,1,getdate())+0,0)) 
  and (targcompdate &lt;= dateadd(month,datediff(month,1,getdate())+1,0)-.001) 


I guess the original problem is integer division, i.e 1/4=0 while 1.0/4=0.25. If you want the result as a percent, multiply with 100.0 instead of 1.0:

select 100.0*count(case when ACTFINISH &lt; TARGCOMPDATE then wonum end) 
     / count(wonum) 
from workorder 
where (status = 'CLOSE' or status = 'COMP') 
  and (woclass = 'WORKORDER' or woclass = 'ACTIVITY')
  and upper(crewid) = '17D02' 
  and istask = 0 
  and siteid = 'INDPLS' 
  and worktype = 'PM' 
  and (targcompdate &gt;= dateadd(month,datediff(month,1,getdate())+0,0)) 
  and (targcompdate &lt;= dateadd(month,datediff(month,1,getdate())+1,0)-.001)