Reputation: 323
I am running this query:
SELECT DATE_ONE, DATEADD(DAY, 7, DATE_ONE) DATE_TWO from TBLA
However, for DATE_TWO, I get the date + 7 days with three additional zeroes in the format.
I need DATE_TWO to be in the same format as DATE_ONE (without the additional 3 zeroes). Is there a way to do this?
Upvotes: 1
Views: 125
Reputation: 11066
Snowflake stores timestamps with nine decimal places for fractional seconds but by default only shows three. If you want to override the default display, use to_varchar() with a format string:
select to_varchar(current_timestamp, 'YYYY-MM-DD HH:MI:SS.FF2');
Upvotes: 2