title: Count rows per hour in SQL Server with full date-time value as result
body: <p>How can I count the number of rows per hour in SQL Server with full date-time as result.</p>
  
  <p>I've already tried this, but it returns only the hours</p>
  
  <pre><code>SELECT DATEPART(HOUR,TimeStamp), Count(*)
  FROM [TEST].[dbo].[data]
  GROUP BY DATEPART(HOUR,TimeStamp)
  ORDER BY DATEPART(HOUR,TimeStamp)
  </code></pre>
  
  <p>Now the result is:</p>
  
  <pre><code>Hour   Occurrence 
  ----   ----------
  10     2157
  11     60740
  12     66189
  13     77096
  14     90039
  </code></pre>
  
  <p>But I need this:</p>
  
  <pre><code>Timestamp               Occurrence
  -------------------     ----------
  2013-12-21 10:00:00     2157
  2013-12-21 11:00:00     60740
  2013-12-21 12:00:00     66189
  2013-12-21 13:00:00     77096
  2013-12-21 14:00:00     90039
  2013-12-22 09:00:00     84838
  2013-12-22 10:00:00     64238
  </code></pre>