DB2 Scalar functions - DATE_TRUNC
THE DATE_TRUNC function truncates a date, time, or timestamp value to the specified time unit.
The schema is SYSIBM.
The format-string values are case insensitive.
If the specified datetime expression is:
If the argument can be null, the result can be null; if the argument is null, the result is the null value.
values date_trunc('MONTH', DATE('2007-02-18')) Result: 2007-02-01 00:00:00
values date_trunc('HOUR', TIMESTAMP('2017-02-14 20:38:40.24')); Result: 2017-02-14 20:00:00
values date_trunc('MINUTE', TIME('20:38:40')); Result: 20:38:00
values date_trunc('MONTH', DECIMAL('00200203')); Result: 00200200
values date_trunc('MINUTE', DECIMAL('102930')); Result: 102900
values date_trunc('HOUR', DECIMAL('00070005032040.000301')); Result: 70005030000.000000