For example,
2024-09-09 13:00:00 will be 2024-09-09 13:05:00
2024-09-09 13:00:50 will be 2024-09-09 13:05:00
2024-09-09 13:01:00 will be 2024-09-09 13:05:00
2024-09-09 13:04:00 will be 2024-09-09 13:05:00
2024-09-09 13:04:59 will be 2024-09-09 13:05:00
2024-09-09 13:05:00 will be 2024-09-09 13:10:00
The answers I find are generally about rounding down, but I want to round up.
Thanks
I tried to use various methods, and adapt the round down to round up, but nothing worked.
2
Answers
Here is the query that will round up a DATETIME to the next 5-minute mark:
Explanation:
Example Output:
2024-09-09 13:00:00 becomes 2024-09-09 13:05:00
2024-09-09 13:00:50 becomes 2024-09-09 13:05:00
300 is the number of seconds in a 5-minute interval.