title: Query returns no results
body: <p>I am running a query that counts emails sent by customers, based on their subject.</p>
  
  <pre><code>    DECLARE @LastMonthNo varchar(2)
      DECLARE @LastMYear varchar(4)
  
      SET @LastMonthNo = DATEPART(m,DATEADD(m,-1,GetDate()))
      SET @LastMYear = DATEPART(yyyy,DATEADD(m,-1,GetDate()));
  
      SELECT 
          CustID, CustName, CustEmail,
          ISNULL(SUM(CASE WHEN EmailSubject LIKE 'KeyWord' THEN 1 END),0) AS TotalEmail
      FROM 
          TableEmails
      WHERE 
          DATEPART(M, DATESENT) = @LastMonthNo
          AND DATEPART(YYYY, DATESENT) = @LastYearNo
  GROUP BY CustID, CustName, CustEmail
  </code></pre>
  
  <p>For some customers, the query returns no results. I do not mean NULL, I mean there is no record at all. However, I need to identify those customers. </p>
  
  <p>What can I do to get the query to generate some sort of results? A 0 would be perfect.</p>