title: SQL Lite - SUM returns null instead of the 0 (zero) value
body: <p>I have this SQL query:</p>
  
  <pre><code>var sqlQuery =
    "SELECT '"+dateRanges[ic].DATE_FROM+"' as DATE_FROM, "+
    " '"+dateRanges[ic].DATE_TO+"' as DATE_TO, "+
    " COUNT(*) AS DIALS_CNT, "+
    " SUM(CASE WHEN dc.call_result = '"+CALL_RESULT_STATE_APPT+"' THEN 1 ELSE 0 END) AS '"+APPT_CNT+"', "+
    " SUM(CASE WHEN dc.call_result = '"+CALL_RESULT_STATE_CONV_NO_APPT+"' THEN 1 ELSE 0 END) AS '"+CONVERS_CNT+"' , "+
    " SUM(CASE WHEN dc.call_result = '"+CALL_RESULT_STATE_CANNOT_REACH+"' THEN 1 ELSE 0 END) AS '"+CANNOT_REACH_CNT+"' "+
    " FROM "+DIALED_CALLS_TABLE+" dc "+
    " WHERE  dc.date BETWEEN '"+dateRanges[ic].DATE_FROM+"' AND '"+dateRanges[ic].DATE_TO+"';";
  </code></pre>
  
  <p>Problem is that if the sum of the values is zero result is containing value null.
  I thought that i can solve it using <code>THEN 1 ELSE 0 END</code>  but it is not working.</p>
  
  <p>How can i solve it please to get result with zeros instead of the null?</p>
  
  <p>Thanks for any help. </p>