[Help]How to get work hours from Time in and Time out of an employee for ms access.

rhonixk08

Board Regular
Joined
Sep 10, 2009
Messages
108
Hi to all expert,

I have a problem in ms access. How can i get the work hours of and employee in their Time in time out logs.

Example:
TABLE1.AM IN
08/08/11 9:00 AM

TABLE1.AM OUT
08/08/11 12:00 PM

TABLE1.PM IN
08/08/11 01:00 PM

TABLE1.PM OUT
08/08/11 6:00 PM

TABLE1.WORKHOURS
8

WHAT FORMULA SHOULD I USE TO GET THE WORK HOURS OF 8?

PLEASE HELP....

MANY THANKS IN ADVANCE.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Funny how questions sometimes arrive in groups...

See if this thread helps. That will give you hours, expressed as a time.
If you want the hours as a number, multiply by 24.

Denis
 
Upvote 0
Sir here's my codes formula in ms access forms, where there's a textbox of logs. AMIN2, AMOUT2, PMIN2, & PMOUT2.
I got an error on this formula, can you correct my codes sir?

Many thanks.

Private Sub click_Click()

Me.wrkhrs.Value = DateDiff((PMOUT2 - AMIN2 + (PMOUT2 < AMIN2)) - (PMIN2 - AMOUT2 + (PMIN2 < AMOUT2))) * 24

End Sub
 
Upvote 0
If they are just entered as times (no date) try;

([AMOUT2]-[AMIN2]+[PMOUT2]-[PMIN2])*24

Of course, this assumes that PMIN is always later than AMOUT. You should have validation in place to make sure that users can't get it wrong.

Denis
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,678
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top