title: Rounding a datetime value down to the nearest half hour
body: <p>I have a requirement to round a datetime2 value down to the nearest half hour. For example '10/17/2013 12:10:00.123' would round down to '10/17/2013 12:00:00.0' And '10/17/2013 12:34:17.123' would round down to 10/17/2013 12:30:00.0'. My first thought was to create a UDF which would break the date and time apart and do it that way. However, I'm wondering if something like this can be done in a single T-SQL statement? </p>
  
  <p>I'm using SQL Server 2012 and the data type of the column is a dateTime2 (which cannot be converted to a float!!)</p>