I would like to round up 15 minutes
2023-10-16 07:54
2023-10-17 07:57
I need them to be , can you please assist?
2023-10-16 8:00
2023-10-17 8:00
I would like to round up 15 minutes
2023-10-16 07:54
2023-10-17 07:57
I need them to be , can you please assist?
2023-10-16 8:00
2023-10-17 8:00
SELECT your_column, DATEADD(MINUTE, CEILING(CEILING(DATEDIFF(SECOND, '19800101', your_column) / 60.0) / 15.0) * 15, '19800101')
In SQL Server 2022, there is a new DATE_BUCKET() function that would work here.
DATEADD(minute, 15, DATE_BUCKET(minute, 15, your_date))