cancel
Showing results for 
Search instead for 
Did you mean: 

converting seconds into time ?

Former Member
0 Kudos
3,800

Hi I am converting seconds into time and I used the following formula:

=FormatNumber(Floor([Elapsed Time]/3600) ;"0") + ":" +

FormatNumber(Floor(Mod([Elapsed Time];3600)/60);"00") + ":" +

FormatNumber(Mod(Mod([Elapsed Time] ;3600) ;60) ;"00")

The problem I now have is it is giving time as

0:02:50
1350:07:59
::
0:11:15
5:05:35
359:55:49
::
0:01:33
6:32:38
::
0:04:20
0:25:53
3:38:58
72:00:04
::
0:02:32
0:16:19
3:41:01

How do I convert something like second row above 1350:07:59 as days which is 56. 

Please help.

Thanks,

View Entire Topic
former_member565459
Participant
0 Kudos

Can you try this:

select

case when floor(130805.75/3600) < 10 then '0' || floor(130805.75/3600)

else '' || floor(130805.75/3600)

end

|| ':'||

case when mod(130805.75,3600) = 0 then '00'

when mod(130805.75,3600) > 0 and mod(130805.75,3600) < 600 then '0' || floor(mod(130805.75,3600)/60)

else ''||floor(mod(130805.75,3600)/60)

end

|| ':'||

case when mod(130805.75,3600) = 0 then '00'

when mod(130805.75,60) < 60 and mod(130805.75,60) < 10 then '0'|| floor(mod(130805.75,60))

when mod(130805.75,60) < 60 and mod(130805.75,60) >= 10 then ''|| floor(mod(130805.75,60))

end

from dummy;