title: SQL Count for each date
body: <p>I have the following need</p>
  
  <p>I have a logging table which logs som leads generated each day.</p>
  
  <p>Now I need to pull a report over the amount of leads for each day over the last 10 days.</p>
  
  <p>Lets say the table looks like this:</p>
  
  <pre><code>tbl_leads
  id int,
  first_name nvarchar(100),
  last_name nvarchar(100),
  created_date datetime
  </code></pre>
  
  <p>And I need to count the number of leads for each day, 10 days total.
  SO the result set should look something like this:</p>
  
  <pre><code>counted_leads | count_date
  5             | 2009-04-30
  7             | 2009-04-29
  5             | 2009-04-28
  7             | 2009-04-27
  </code></pre>
  
  <p>... and so on</p>
  
  <p>Anyone know how to do this the best possible way?
  My current solution is iterating with a foreach in c# but I would very much like to hand it on the sql server instead in a sp.</p>