SQL Server - Time Chunking
Show timestamps as being in their corresponding chunk of time.
e.g.
In this case show the current timestamp as the current 5 minute time chunk.
So 2026-04-22 12:49:00 would show as 2026-04-22 12:45:00.
SELECT
DATEADD(SECOND, (CAST((DATEPART(SECOND, CURRENT_TIMESTAMP) / 5) AS INT) * 5), CAST(DATEADD(MINUTE, DATEDIFF(MINUTE, 0, CURRENT_TIMESTAMP), 0) AS DATETIME2));