You can do this using many functions:
WITH D AS ( SELECT CURRENT_TIMESTAMP [DateField] UNION ALL SELECT DATEADD(MINUTE, 5, CURRENT_TIMESTAMP) ) SELECT DATEADD(MINUTE, (10 * FLOOR(DATEPART(MINUTE, DateField) / 10.0)) - DATEPART(MINUTE, DateField), DATEADD(MINUTE, DATEDIFF(MINUTE, 0, DateField), 0)) AS RoundedDate FROM D
The bottom line is to remove the number of minutes in a 10-minute interval and subtract this from the actual number of minutes (with the removal of seconds).
You can pick this up a bit by moving some of the functions to the connection. However, I do not think that this gives any performance gain (no testing at all)
;WITH T AS ( SELECT Number, (10 * FLOOR(Number / 10.0)) - Number [RoundedDifference] FROM ( SELECT ROW_NUMBER() OVER(ORDER BY Object_ID) - 1 [Number] FROM sys.All_Objects ) n WHERE Number < 60 ), D AS ( SELECT CURRENT_TIMESTAMP [DateField] UNION ALL SELECT DATEADD(MINUTE, 5, CURRENT_TIMESTAMP) ) SELECT DateField, DATEADD(MINUTE, RoundedDifference, DATEADD(MINUTE, DATEDIFF(MINUTE, 0, DateField), 0)) [RoundedDate] FROM D INNER JOIN T ON DATEPART(MINUTE, DateField) = Number
source share