benkingery
Registered User.
- Local time
- Yesterday, 19:36
- Joined
- Jul 15, 2008
- Messages
- 153
I have a table that I want to use for a time clock. There are 6 columns:
EmployeeID
Date
ArriveTime
LunchOut
LunchIn
DepartTime
The PK is made up of EmployeeID and Date.
My question is kind of two-fold. 1) What datatype should I set the time fields so that I can run a query to add up the hours worked.
2) If I used date/time for date fields as I have, I'm running a query that has ([DepartTime]-[ArriveTime])-([LunchIn]-[LunchOut]) as the formula. I am getting some wierd results.
Example:
Arrive time of 8:00 am
Lunch out of 12:00 pm
Lunch In of 1:00 pm
Depart of 5:00 pm
...is yielding me .33333333333334
Anything someone can do to help me?
EmployeeID
Date
ArriveTime
LunchOut
LunchIn
DepartTime
The PK is made up of EmployeeID and Date.
My question is kind of two-fold. 1) What datatype should I set the time fields so that I can run a query to add up the hours worked.
2) If I used date/time for date fields as I have, I'm running a query that has ([DepartTime]-[ArriveTime])-([LunchIn]-[LunchOut]) as the formula. I am getting some wierd results.
Example:
Arrive time of 8:00 am
Lunch out of 12:00 pm
Lunch In of 1:00 pm
Depart of 5:00 pm
...is yielding me .33333333333334
Anything someone can do to help me?