title: Count rows per hour in SQL Server, appending zeroes for the time gaps in between
body: <p>I am trying to count the rows per hour from a table in SQL Server. The result I'm looking for is to have a count for each hour of my data (even though the entries span over different minutes of each hour), essentially aggregating the data.</p>
  
  <p>This is a similar question to <a href="https://stackoverflow.com/questions/20719901/count-rows-per-hour-in-sql-server-with-full-date-time-value-as-result">Count rows per hour in SQL Server with full date-time value as result</a></p>
  
  <p>The answer to this question is almost what I'm looking for, except it does not include hours for which the count was 0. So essentially I'm trying to fill in these gaps with zeroes, so that I can have 24 points for each day.</p>
  
  <p>Any help appreciated</p>
  
  <p>Thank you</p>