Example: Truncating Digits in Fractional Seconds - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

This is an example of truncating digits in fractional seconds according to the requested format of FF[1..9] for milliseconds in the timestamp value:

select to_char(timestamp '2020-09-01 23:45:09.999999','yyyy-mm-dd hh:mi:ss.FF1');

The result is:

to_char(2020-09-01 23:45:09.999999,'yyyy-mm-dd hh:mi:ss.FF1')
-------------------------------------------------------------
2020-09-01 11:45:09.9