I have a requirement where i want to change my Timestamp based on some condition:
Ex: Time stamp is : 2022-01-10 16:10:12.142 where minutes value is 10(if minutes value is <29 i want to change minute value as 0) so result should be:
Expected - 2022-01-10 16:00:00.000
And if timestamp value is : 2022-01-10 16:45:12.142 where minutes value is 45(if minutes value is >30 it should be 30) so expected output should be like
exp - 2022-01-10 16:30:00.000
please can any 1 help me that how can i achive in dremio.
General formula is: SELECT TO_TIMESTAMP(UNIX_TIMESTAMP(your_timestamp_column, 'YYYY-MM-DD HH24:MI:SS.FFF') - UNIX_TIMESTAMP(your_timestamp_column,'YYYY-MM-DD HH24:MI:SS.FFF')%your_granularity_in_seconds)