How To Get Total Hours Worked?????

  • Thread starter Thread starter feretz
  • Start date Start date
F

feretz

Guest
Hi There, :)

using Access how would i go about creating a query that will sum up the
total hours worked over a working week. :confused:

Here is an example of what i would like it to do..

................mon..... tues..... wed..... thur..... fri..... sat..... sun
Hrs worked 7.30.... 16.00.... d/off.... 7.30..... d/o.. 11.30.. 11.30 :total Hrs= ??:??

the problem i am getting is that i can't get the correct total Hrs:Min due to the 24hr and
the 60min factor .

I would be realy greatful if someone could help me with this problem.

Many thanks to anybody who will take time to point me in the right direction. ;)
 
feretz said:
................mon..... tues..... wed..... thur..... fri..... sat..... sun
Hrs worked 7.30.... 16.00.... d/off.... 7.30..... d/o.. 11.30.. 11.30 :total Hrs= ??:??
7.30 is 7 hours and 30 minutes?
16.00 is 16 hours and 0 minutes?
11.30 is 11 hours and 30 minutes?

w
 
Your problem is that time isn't what you think it is.

Internally, a date field is a DOUBLE (64-bit) floating point COUNT of days plus fraction since midnight of a reference date. If you are using date fields to keep times, your formatting will get all hosed up. This occurs because dates contain a bias that is pretty big by now. The bias is a number in the general range of well over 36,524 days (=1 century in days).

Keep time as SINGLE or DOUBLE but in units of HOURS, not a date field. Then just add them as hours and fractions of hours.

Now, if you are using a non-standard format for representation (11.30 meaning half-past-11 or 11 1/2 hours, vice 11:30), you will also need to write a conversion function (probably two such functions: One IN and the other OUT.) If you do this, make them public functions in a general module. That way you can perform conversions in queries, forms, or reports.
 
Feretz,

Refer to the following post for your particular problem. Although it uses set hours from Monday through Friday, you can probably adjust as you see fit.

Business Hours Calculation
 

Users who are viewing this thread

Back
Top Bottom