Help with time.

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
 
D

Duane Hookom

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.
 
M

Marshall Barton

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")
 

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