All Forums Analytics
Johnmghenry 11 posts Joined 04/15
29 Apr 2015
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: 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

downloads_2014 3 posts Joined 08/14
01 Jul 2015

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

You must sign in to leave a comment.