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
@Twinkles's answer works well in SQL server to round to closest half an hour.
However, in development, strongly recommend use FLOOR to round to last half an hour.
SELECT CONVERT(datetime, FLOOR(CAST([columnname] AS float) * 48.0)/48.0) FROM [tableName]