title: Floor a date in SQL server
body: <p>In SQL Server, how do I "floor" a DATETIME to the second/minute/hour/day/year?</p>
  
  <p>Let's say that I have a date of <strong>2008-09-17 12:56:53.430</strong>, then the output of flooring should be:</p>
  
  <ul>
  <li>Year:  2008-01-01 00:00:00.000</li>
  <li>Month: 2008-09-01 00:00:00.000</li>
  <li>Day: 2008-09-17 00:00:00.000</li>
  <li>Hour: 2008-09-17 12:00:00.000</li>
  <li>Minute: 2008-09-17 12:56:00.000</li>
  <li>Second: 2008-09-17 12:56:53.000</li>
  </ul>