title: SQL - How to ignore seconds and round down minutes in DateTime data type
body: <p>At work we did a project that required a team to count students 8 times a day over 5 days at specific time periods. They are, as follows :- </p>
  
  <pre><code>09:00, 10:00, 11:00, 13:15, 14:15, 14:50, 15:50, 16:20.
  </code></pre>
  
  <p>Now, the data collected was put directly into a database via a web app. The problem is that database recorded each record using the standard YYYY-MM-DD HH:MM:SS.MIL, but if I were to order the records by date and then by student count it would cause the following problem; 
  e.g.:-</p>
  
  <p>if the students counted in a room was 5 at 09:00:12, but another room had a count of 0 at 09:02:20 and I did the following:</p>
  
  <pre><code>select student_count, audit_date
  from table_name
  order by audit_date, student_count;
  </code></pre>
  
  <p>The query will return:</p>
  
  <pre><code>5 09:00:12
  0 09:02:20
  </code></pre>
  
  <p>but I want:</p>
  
  <pre><code>0 09:00:00
  5 09:00:00
  </code></pre>
  
  <p>because we're looking for the number of students in each room for the period 09:00, but unfortunately to collect the data it required us to do so within that hour and obviously the database will pick up on that accuracy. Furthermore, this issue becomes more problematic when it gets to the periods 14:15 and 14:50, where we will need to be able to distinguish between the two periods.</p>
  
  <p>Is there a way to ignore the seconds part of the DateTime, and the round the minutes down to the nearest ten minute?</p>
  
  <p>I'm using SQL Server Management Studio 2012. If none of this made sense, I'm sorry!</p>