case when substr( CAST((timestamp_col (FORMAT 'YYYY-MM-DDBHH:MI:SS.S(6)')) AS VARCHAR(26)) ,18,2) > 59 then substr( CAST((timestamp_col (FORMAT 'YYYY-MM-DDBHH:MI:SS.S(6)')) AS VARCHAR(26)) ,1,17) || '59' || substr( CAST((timestamp_col (FORMAT 'YYYY-MM-DDBHH:MI:SS.S(6)')) AS VARCHAR(26)) ,20) else CAST((timestamp_col (FORMAT 'YYYY-MM-
DDBHH:MI:SS.S(6)')) AS VARCHAR(26)) end
sel
(cast(trns_strt_ts as date) -1)
||' '|| substr(CAST((trns_strt_ts(format'YYYY-MM-DDBHH:MI:SS.S(6)')) AS VARCHAR(26)) ,12,8) AS trns_strt_ts
from r_actl_trns where fr_loc_id = 'S21'