Link to home
Create AccountLog in
Avatar of mishlce
mishlce

asked on

Calculate Start Time and End Time to get a TOTAL TIME

ACCESS TABLE:  This is an access table and I am trying to come to a Total Time in Minutes for each line item.  
I need to subtract Start Time from End Time to get total.
My issue is I have some that cross over midnight and I am not sure how to calculate them.  
Some do not cross over midnight.

Column O is result I want.  

I am not sure if I should use the field with date and time in same field or the short time with only the time in the field?  
I also do not know the formula to calculate and get to results of total minutes per line item.
EmpTimeCalc.xls
Avatar of mds-cos
mds-cos
Flag of United States of America image

If you store entire date/time in your date/time field your calculations should come out correct.

If this is not an option, and if the assumption "if end time is less than start time we ran over midnight" is valid, you can still figure it out.  Put an if check into your caluclation to see if start time is greater than end time.  If it is, add 24 hours to your end time to get result (think in terms of a 24 hour clock, not 12 hour clock --- so start at 11pm is 23:00)
Avatar of David Johnson, CD
Very easy subtract the start time (full) - endtime(full)   show as time hh:mm
Copy-of-EmpTimeCalc.xls
Avatar of mishlce
mishlce

ASKER

mds-cos

I do have a field with the entire start date/time and end date/time in the same field.  I am looking for how to write the calculation to get the Total Shilft Time for each line item.  I see what you are saying but can you provide the exact formula for the calculation in access.
ASKER CERTIFIED SOLUTION
Avatar of Jeffrey Coachman
Jeffrey Coachman
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of mishlce

ASKER

I had others that made comments and provided answers in excel, but not in access as I originally requested. I then did not get the answers I was looking for.  

 This is exactly all I wanted.  Someone to proivide me an example with the formula in the querie.  Thanks boag2000.