Change seconds to hhh:nn:ss

G

Guest

I have a a field which contains seconds and want to convert this to hours,
minutes seconds.

The hours are time worked and are sometimes over 100 hours. When I use the
following formula I get the wrong answer.

Staffed_Time: Format(([staffed Time]/(24*60*60)),"h:nn:ss")

Data input - 470217
Data output - 10:36:57 Should be 130:36:57

Any ideas?
 
R

Rick B

I could be wrong here, but it seems to me there are 3,600 seconds in an
hour. 60 seconds in a minute X 60 minutes in an hour. Why do you have the
"24*" in your equation?


Rick B
 
R

Rick B

Nevermind.


Rick B said:
I could be wrong here, but it seems to me there are 3,600 seconds in an
hour. 60 seconds in a minute X 60 minutes in an hour. Why do you have the
"24*" in your equation?


Rick B



F Jones said:
I have a a field which contains seconds and want to convert this to hours,
minutes seconds.

The hours are time worked and are sometimes over 100 hours. When I use the
following formula I get the wrong answer.

Staffed_Time: Format(([staffed Time]/(24*60*60)),"h:nn:ss")

Data input - 470217
Data output - 10:36:57 Should be 130:36:57

Any ideas?
 
K

Kalle via AccessMonster.com

I am afraid you have to add the days manually. "h" cannot be greater than 23 I guess.

The following lines should solve your problem.

dt = [staffed Time]/(24*60*60)

timestring = (day(dt) * 24 + hour(dt)) & ":" & min(dt) & ":" & second(dt)

Kalle
 

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