How can I show elapsed time?

  • Thread starter Thread starter plh
  • Start date Start date
P

plh

How can I get Access to show the difference between two times as an elapsed
time?
That is, the start time (in one test box) is 2:36:00 and the finish time (in
another text box) is 2:42:00.
Another text box shows the difference. I want it to read:
0:06 (zero hours 6 minutes, I don't need the seconds) rather than
12:06 AM as it does now. Also, I want it to be able to store more than 24 hours.
Another way I could have it would be in decimal fractino of an hour. That would
make the above elapsed time read:
0.1 hr
or just
0.1
because I could just have the "hr" part on a label to the right of the text box.
Thanx,
-plh

I keep hitting "Esc", but I'm still here!
(If "123" is in the email address that's and anti-spam thing - remove it)
 
plh said:
How can I get Access to show the difference between two times as an elapsed
time?
That is, the start time (in one test box) is 2:36:00 and the finish time (in
another text box) is 2:42:00.
Another text box shows the difference. I want it to read:
0:06 (zero hours 6 minutes, I don't need the seconds) rather than
12:06 AM as it does now. Also, I want it to be able to store more than 24 hours.
Another way I could have it would be in decimal fractino of an hour. That would
make the above elapsed time read:


The recommended way to calculate the elapsed time is to use
the DateDiff function on the lowest unit of interest:

ElapsedTime = DateDiff("n", finishtime, starttime)

This provides the total number of minutes between the two
times. Now, the question is how to format that number to
display it in hours and minutes. Here's a text box
expression to do that:
=(ElapsedTime \ 60) & Format(ElapsedTime Mod 60, "\:00")
 
Back
Top