Need to convert this hh:mm:ss data into seconds. Is there any function available in snowflake ?

404

AzharuddinK

posted on

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds




Were you able to find a solution ? If yes, can you kindly share

BlackPearl

Hi Azharuddink can you use this

 CAST(SHIP_DT AS TIMESTAMP(0)) + (SHIP_TM - TIME '00:00:00' HOUR TO SECOND) AS SHIP_DTTM

Hi, it'll be very helpful if you could explain what you did?

I did it this way 

substr(substr(a.CONNECTING_TIME,0,2)*3600 + substr(a.CONNECTING_TIME,4,2)*60 + substr(a.CONNECTING_TIME,7,2),1,charindex('.',substr(a.CONNECTING_TIME,0,2)*3600 + substr(a.CONNECTING_TIME,4,2)*60 + substr(a.CONNECTING_TIME,7,2),1)-1)

Thank you for posting the answer. Its helpful