Seconds as DD:HH:MM:SS

P

Paul Dennis

Trying to use = ([Interval] \ 86400) & ":" & Format(([Interval] \ 3600) Mod
60, "00") & ":" & Format(([Interval] \ 60) Mod 60, "00") & ":" &
Format([Interval] Mod 60, "00")

to convert interval to DD:HH:MM:SS however the calculation is off. If there
is a day in the seconds then the hours are incorrect.

Any ideas?
 
J

John Spencer

Perhaps you need Mod 24 vice Mod 60 in the hours calculation

= ([Interval] \ 86400) & ":"
& Format(([Interval] \ 3600) Mod 24, "00") &
":" & Format(([Interval] \ 60) Mod 60, "00") & ":" &
Format([Interval] Mod 60, "00")"
 
O

OfficeDev18 via AccessMonster.com

Instead of using ([Interval] \ 86400), (with the back slash) which denotes
integer division only, try using the front slash ("/") instead, which allows
the decimal as well. Or do you want only the integer value....

Sam

Paul said:
Trying to use = ([Interval] \ 86400) & ":" & Format(([Interval] \ 3600) Mod
60, "00") & ":" & Format(([Interval] \ 60) Mod 60, "00") & ":" &
Format([Interval] Mod 60, "00")

to convert interval to DD:HH:MM:SS however the calculation is off. If there
is a day in the seconds then the hours are incorrect.

Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top