any better way to avoid 7th digit as part of the nano seconds in the timestamp literal

Database
Highlighted
Tourist

any better way to avoid 7th digit as part of the nano seconds in the timestamp literal

I was wondering if there is any better way to round off or remove the 7th digit in the nano seconds in the timestamp literal like in the example below. In this case the digit "2" at the end need to be ignored(rounding off is not much needed but good to have). Without that casting to timestamp(6) is erroring out. I was thinking initally of using the sub string function two times to remove the same. Thanks.

 

SyntaxEditor Code Snippet

SEL CAST('2018-04-23T11:22:33.0000002-07:00' AS TIMESTAMP(6))

 

Tags (2)