title: how to divide SUM(CASE...)es?
body: <p>I need to gain percentage by dividing two SUM variables. But when I try the code below, it gives me 0 as result. How can I divide these two SUMs?</p>
  
  <p>Thanks! </p>
  
  <p>(SUM(Case When FinalApprovalDt is not null and ContractPayoutAmt > 0 Then 1 else 0 End) / SUM(Case when FinalApprovalDt is not null then 1 else 0 end)* 100) As WriteRate</p>