DateTime Rounding
Description
DateTime rounding functions round down the subordinates of the chosen time unit into the ground state. They can be applied to DATE columns and always return a DATE column.
The ground states are:
MONTH: 01
DAY: 01
HOUR: 00
MINUTE: 00
SECOND: 00
MILLISECOND: 000
The following functions are available:
ROUND_SECOND, ROUND_MINUTE, ROUND_HOUR, ROUND_DAY, ROUND_MONTH, ROUND_QUARTER and ROUND_YEAR round down the subordinates of the respective time unit into the ground state.
The ROUND_WEEK function is handled slightly different: This function also rounds down the HOUR, MINUTE, SECOND and MILLISECOND values, but the DAY value will not be in its ground state. Instead, the day will be chosen as the Monday of the week of that date.