Number to time

G

Guest

I have a field called seconds formatted as number long integer. I want to
convert this to hh:nn:ss only. I don't want to convert this to an AM/PM time
as I want to show total hours, min, seconds training for the year. Also, can
this be done so it any of the figures show only one digit (i.e. minutes were
4) that it displays as 04. I would like the end result to show like this

130:04:08

Thank you.
 
J

Jeff Boyce

One approach would be to "do the math". Hours are the result of an integer
divide ("\") by the number of seconds in an hour (3600). The remainder,
integer divided by the number of seconds in a minute (60) will give you the
minutes. The remainder of THIS, is the seconds.

You can use Format() and concatenating to come up with "hh:mm:ss" as a
display format. Note, however, that this will be a text display, not a
number.
 

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