title: Return 0 for no rows returned using SUM and IIF in MS Access
body: <p>I am looking for a way to return <strong>0</strong> as result for a SQL Query in MS Access when no rows are returned. Following is my query:</p>
  
  <pre><code>SELECT SUM(IIF(TotalCount =  null, 0, TotalCount)) AS MailCount  FROM MailReport WHERE [SendDate]=#2/12/2013# and MailerID=1
  </code></pre>
  
  <p>Here the Column <code>TotalCount</code> is number type and works fine for a query that returns some result. But in case for example date <code>2/13/2013</code> has no records, it would simply return a <code>blank</code> row that is nither <code>0</code> nor <code>null</code>. How do I return a 0 for this row.</p>