Cast Seconds (Data type HS) too Hour:Minutes:Seconds Time data type

Analytics
Enthusiast

Cast Seconds (Data type HS) too Hour:Minutes:Seconds Time data type

I have a time stored in HS format. So the time will look like '0 20:50:00.000000'.

I need to convert this to the data type time.  When I simply try to 

cast(HStime to time)

I get the error, invalid operation on datetime or interval.

Another proposed solution for this online is:

http://stackoverflow.com/questions/16494301/teradara-casting-seconds-to-hours-minutes-and-seconds

However, this gave me the error 'Syntax error: expected something between the word 'HStime' and the 'SECOND' keyword'

Please help clarify how a HS interval can be converted to hour:minute:second

1 REPLY
Enthusiast

Re: Cast Seconds (Data type HS) too Hour:Minutes:Seconds Time data type

select cast(substr('0 20:50:00.000000',index('0 20:50:00.000000',' ')) as time);