Time Calculations

  • Thread starter Thread starter abirbal
  • Start date Start date
A

abirbal

Guest
I am creating a Time and Attendance Access 97 application in which an employee is asked to enter the time that they start work, the time they leave for lunch, the time they arrive from lunch and the time they leave for the day. I need to calculate the total number of hours worked based on these four pieces of information. How do I go about this in Access?
 
hi, im doing something similar in a database im creating, i have a seperate field for the time in and time out for each day, which means 4 fields per day if u take into account lunch, this is all one seperate table,
then, i created a query, in which i worked out the total number of hours between in time and quiting time, using this expression
Total Weekly Hours not including Lunch: Sum((Hour([Staff_Register_tbl]![Time Out Monday])-(Hour([Staff_Register_tbl]![Time in Monday])))+((Hour([Staff_Register_tbl]![Time out Tuesday]))-(Hour([Staff_Register_tbl]![Time in Tuesday])))+((Hour([Staff_Register_tbl]![Time Out Wednesday]))-(Hour([Staff_Register_tbl]![Time in Wednesday])))+((Hour([Staff_Register_tbl]![Time Out Thursday]))-(Hour([Staff_Register_tbl]![Time in Thursday])))+((Hour([Staff_Register_tbl]![Time Out Friday]))-(Hour([Staff_Register_tbl]![Time in Friday]))))

its long i know!!!

then, i worked out the ammount of lunch hours per week using this one...

Total Lunch hours: Sum(((Hour([Staff_Register_tbl]![Lunch In Monday]))-(Hour([Staff_Register_tbl]![Lunch Out Monday])))+((Hour([Staff_Register_tbl]![Lunch In Tuesday]))-(Hour([Staff_Register_tbl]![Lunch Out Tuesday])))+((Hour([Staff_Register_tbl]![Lunch In Wednesday]))-(Hour([Staff_Register_tbl]![Lunch Out Wednesday])))+((Hour([Staff_Register_tbl]![Lunch In Thursday]))-(Hour([Staff_Register_tbl]![Lunch Out Thursday])))+((Hour([Staff_Register_tbl]![Lunch In Friday]))-(Hour([Staff_Register_tbl]![Lunch Out Friday]))))

then, simple take the lunch total from the first total,
its not simple i know, and there probly is an easier way to do it, if so, please tell me also
Peter
 
If your fields are called Time_1, Time_2 etc place this formula in the 'Field:' row of the query window and it should calculated the working day for you.

Working_Day: (DateDiff('n',[Time_1],[Time_2])+DateDiff('n',[Time_3],[Time_4]))/60

Hope this helps.

Cheers,

Former
 

Users who are viewing this thread

Back
Top Bottom