title: SQL Count Records, Group By Date and fill in missing date?
body: <p>I have the following SQL Query that counts Orders and groups them by each Day (Date).</p>
  
  <p>Thus the following results:</p>
  
  <pre><code>01/02/2014 = 10
  02/02/2014 = 2
  05/02/2014 = 7
  07/02/2014 = 4
  </code></pre>
  
  <p>Query:</p>
  
  <pre><code>SELECT TOP(@NumberOfRecords) DATEADD(dd, 0, DATEDIFF(dd, 0, AddedDate)) AS Date,       COUNT(DISTINCT ID) AS Count 
            FROM OrderSpecs
            GROUP BY DATEADD(dd, 0, DATEDIFF(dd, 0, AddedDate)) 
            ORDER BY Date DESC
  </code></pre>
  
  <p>My question is, how can I get my Query to fill in any of the in-between missing dates and set the Count value to 0?</p>
  
  <p>Example Desired Results:</p>
  
  <pre><code>    01/02/2014 = 10
      02/02/2014 = 2
      03/02/2014 = 0
      04/02/2014 = 0
      05/02/2014 = 7
      06/02/2014 = 0
      07/02/2014 = 4
  </code></pre>
  
  <p>Many thanks for you time taken out to read this.</p>