SQL - Scalar functions - TRUNC_TIMESTAMP
The TRUNC_TIMESTAMP scalar function returns a TIMESTAMP that is an argument (expression) truncated to the unit specified by another argument (format-string).
The schema is SYSIBM.
If format-string is not specified, expression is truncated to the nearest day, as if 'DD' was specified for format-string.
Allowable values for format-string are listed in the table of format elements found in the description of the ROUND function.
The result of the function is a TIMESTAMP with the same timestamp precision as expression. The result can be null; if any argument is null, the result is the null value.
The result of the function is a TIMESTAMP with a timestamp precision of:
Set the host variable TRNK_TMSTMP with the current year rounded to the nearest year value.
SET :TRNK_TMSTMP = TRUNC_TIMESTAMP('2000-03-14-17.30.00', 'YEAR');