convert seconds into hh:mm:ss


G

Guest

I am setting up a report. In this report, I have a field that is populated
from a query with the average seconds that a person is on a phone call. I'm
trying to get the numbers to calculate to the HH:MM:SS format.
 
Ad

Advertisements

G

Guest

I am sure I understand. If you want the differance between 2 time use
DateDiff("s", date1, date2). This will give you the differance in seconds
between the 2 times.

If you already have the differance and want to format a time out to the
seconds then for format(time,"hh:mm:ss") or format(time,"Long Time").

Dale
 
W

Wayne Morgan

To convert Seconds into Hours:Minutes:Seconds, try this formula. The
formatting will give a minimum of 2 digits for each part.

Format([Seconds]\3600, "00") & ":" & Format(([Seconds]-
([Seconds]\3600)*3600)\60, "00") & ":" & Format(([Seconds] Mod
3600)-(([Seconds]- ([Seconds]\3600)*3600)\60)*60, "00")

Replace "Seconds" with the name of the field that holds the seconds. The "\"
is integer division. The parentheses are needed because it isn't done in the
order of normal division.
 
G

Gregory Paret

Dmackcwby said:
I am setting up a report. In this report, I have a field that is populated
from a query with the average seconds that a person is on a phone call. I'm
trying to get the numbers to calculate to the HH:MM:SS format.
Format([YourSecondsField]/86400, "hh:mm:ss")

86400 is the number of seconds in a day (24*60*60.)

-Greg.
 
Ad

Advertisements

W

Wayne Morgan

Thanks Greg, I knew there had to be a simpler formula.

--
Wayne Morgan
MS Access MVP


Gregory Paret said:
Dmackcwby said:
I am setting up a report. In this report, I have a field that is
populated from a query with the average seconds that a person is on a
phone call. I'm trying to get the numbers to calculate to the HH:MM:SS
format.
Format([YourSecondsField]/86400, "hh:mm:ss")

86400 is the number of seconds in a day (24*60*60.)

-Greg.
 

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

Similar Threads

Second column 1
Suppress Second Page 1
Second set of totals 4
Second Page of data 1
Add a second count 0
second time lucky? 4
last and second last 0
SECOND REQUEST - Article 814779 1

Top