Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cumulative summing of hours

Status
Not open for further replies.

Stroppy

IS-IT--Management
Jul 19, 2002
293
AU
Hello all,

I have started dabbling in MS Access, thus, my knowledge of the product is fairly limited. So, I've created a fairly simple database for work. It's for adding up the time people spend in the office. The data comes from a simple sign in & sign out book.

Everything's good...I've made a form and it's all working well. I'm trying to do a report with three headings: month, hours, cumulative hours. Problem is that I don't know how to format the cumulative hours so that it comes out as a total of hours rather than as a time. Eg, it added up my test data to 17, but after adding another 9 hours it says "2". ?? 2 days? Any help would be appreciated.

M
 
I think your issue might be that you are attempting to display a duration of time as date/time which is better used for a point in time. For instance, if I aske you how long was your usual work day, you would reply something like:
8 Hours
not
8 o'clock

Date/time values are stored as floating point numbers. 0 is December 30, 1899 at 12:00 am. Displaying any date/time value as a time format will display at the most 23:59. When the duration of time exceeds 24 hours, the days aren't displayed.

I would simply sum the DateDiff("n",[TimeIn], [TimeOut]) which will give you minutes. If you want to display hours, divide by 60.


Doug Steele has a more complete date diff function at
Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top