time format

  • Thread starter Thread starter val
  • Start date Start date
V

val

I have a form tracking elapsed time. End time - start time
in a query with result as a number. At footer of form I
have SUM of all elapsed times. I can get sum as a number
but, want to display result as time. I need result to show
days/hours/ minutes/seconds. Format hh:nn:ss works until I
have more than one day elapsed time. I tried d:hh:nn:ss but
then day value was not correct, I had over 5 days elapsed
time and for some reason it showed only 4 days.General date
doesn't work at all. I could deal with elapsed time
displayed only in hours minutes seconds but, hours will be
over 23. Any suggestions?
 
I have a form tracking elapsed time. End time - start time
in a query with result as a number. At footer of form I
have SUM of all elapsed times. I can get sum as a number
but, want to display result as time. I need result to show
days/hours/ minutes/seconds. Format hh:nn:ss works until I
have more than one day elapsed time. I tried d:hh:nn:ss but
then day value was not correct, I had over 5 days elapsed
time and for some reason it showed only 4 days.General date
doesn't work at all. I could deal with elapsed time
displayed only in hours minutes seconds but, hours will be
over 23. Any suggestions?

Date/Time values are really not appropriate for durations: as you note
they'll wrap at 24 hours, and they will give wierd results in other
cases (negative durations for example!)

I'd suggest using DateDiff() to calculate the duration in seconds, and
then use an expression or a simple VBA function to display it as
d:hh:nn:ss format. For some code to do this see Doug Steele's "More
Complete DateDiff Function" at

http://members.rogers.com/douglas.j.steele/Diff2Dates.html
 
Back
Top