converting seconds to hh:nn:ss

G

Guest

Hi,

I receive a report in excel that counts "call" times in seconds (eg 400
seconds). I am importing the spreadsheet into a access table, but I can't
find a way to convert it to hh:nn:ss format. its farily easy in excel, just
devide the number to 60/60/24, and then custom format the fields to hh:mm:ss.

Is there a way to do this on either a table or a report in access?

thanks!
 
O

OfficeDev18 via AccessMonster.com

Change the amount of seconds to a fraction of a day, which is represented as
the number 1.

0.5 is 12 hours, 0.25 is 6 hours, etc. 1 second is 1.15740740740741E-05. All
you need to do is Dim a Double variable, maybe call it OneSecond, and
initialize it to 1.15740740740741E-05. In your Format statement, say Format
(CallTime*OneSecond,"hh:nn:ss"), since the value comes to you in seconds.

HTH
 
M

Marshall Barton

mikeh said:
I receive a report in excel that counts "call" times in seconds (eg 400
seconds). I am importing the spreadsheet into a access table, but I can't
find a way to convert it to hh:nn:ss format. its farily easy in excel, just
devide the number to 60/60/24, and then custom format the fields to hh:mm:ss.

Is there a way to do this on either a table or a report in access?


Use an expression in a report text box or in the report's
record source query:

tm \ 3600 & Format((tm Mod 3600) \ 60, "\:00") & Format(tm
Mod 60, "\:00")
 

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