title: SQL - How to count records for each status in one line per day?
body: <p>I have a table <code>Sales</code></p>
  
  <pre><code>Sales
  --------
  id
  FormUpdated
  TrackingStatus
  </code></pre>
  
  <p>There are several status e.g. <code>Complete</code>, <code>Incomplete</code>, <code>SaveforLater</code>, <code>ViewRates</code> etc.</p>
  
  <p>I want to have my results in this form for the last 8 days(including today).</p>
  
  <p>Expected Result:</p>
  
  <pre><code>Date Part of FormUpdated, Day of Week, Counts of ViewRates, Counts of Sales(complete), Counts of SaveForLater
  --------------------------------------
  2015-05-19   Tuesday    3   1   21  
  2015-05-18   Monday     12  5   10
  2015-05-17   Sunday     6   1   8
  2015-05-16   Saturday   5   3   7 
  2015-05-15   Friday     67  5   32
  2015-05-14   Thursday   17  0   5 
  2015-05-13   Wednesday  22  0   9
  2015-05-12   Tuesday    19  2   6
  </code></pre>
  
  <p>Here is my sql query:</p>
  
  <pre><code>select  datename(dw, FormUpdated), count(ID), TrackingStatus 
  from Sales
  where FormUpdated &lt;= GETDATE()
  AND FormUpdated &gt;= GetDate() - 8
  group by  datename(dw, FormUpdated), TrackingStatus
  order by  datename(dw, FormUpdated) desc
  </code></pre>
  
  <p>I do not know how to make the next step.</p>
  
  <h2>Update</h2>
  
  <p>I forgot to mention, I only need the Date part of the <code>FormUpdated</code>, not all parts.</p>