I'm trying to divide in a case statement. I used nullif to control for the divide by zero error. However, my response is always 0. I'm not sure what I'm doing wrong. Here is the statement:
sum(CASE WHEN aw.goalmet LIKE 'yes' THEN 1 ELSE 0 end)/nullif(sum(case WHEN aw.goalmet IN ('yes', 'no') then 1 else 0 end),0) AS 'Total Passing AIMSWEB2'