Help with time.

  • Thread starter Thread starter Floyd Forbes
  • Start date Start date
F

Floyd Forbes

How do I sum the amount of time on a report if timein is 7:42 AM and
timeout is 12:33 PM. Is there a easy way of doing this?

Thanks
 
Time is stored as a number. You can add times like you can add numbers. You
can also use one of the many date/time functions like:
DateDiff("S", [EarlyTimeValue], [LaterTimeValue])
The "S" gives the time in seconds. You can use "n" for minutes as well as
many other intervals.
In a report or group Header or Footer, you can use a control source like:
=Sum(DateDiff("n", [EarlyTimeValue], [LaterTimeValue]))
This will return the Sum of the time duration in minutes between a the time
values.
 
Floyd said:
How do I sum the amount of time on a report if timein is 7:42 AM and
timeout is 12:33 PM.


Assuming the time in and time out fields in the table
include the date, then use text boxes in the report footer
section.

txtMinutes text box:
=Sum(DateDiff("n", TimeIn, TimeOut)

txtHoursMins text box
=txtMinutes \ 60 & Format(txtMinutes Mod 60, "\:00")
 
Back
Top