Calc Hours minus Breaks

  • Thread starter Thread starter chopper57 via AccessMonster.com
  • Start date Start date
C

chopper57 via AccessMonster.com

My database has a start time and finish time and I also have a column for
breaks, I just changed my calculations totals from hours.fraction so it reads
hours:minutes by using Allen Browns Calcuating Elapsed time and other info
for working past midnight (night shift) works fine.

This is what I have to change medium time to minutes:
Minutes: IIf(DateDiff("n",[Start],[Finish])<0,DateDiff("n",[Start],[Finish])
+1440,DateDiff("n",[Start],[Finish]))

My Break column is presently set to whole numbers, so I would enter 0.5 for
30 minutes.
What would I change this column to and how to work it in the formula or make
another column in the query to make it work where the break time is
subtracted from total minutes.

I thought of just making it total minutes on break like just entering 90
minutes for 1:30 (hour and half).
Would this be the best way?
 
Yes, use a Number column (Long Integer size) for your Break column to store
the number of minutes to subtract. You can then subtract [Break] from the
minutes column.

If you want to keep the Break field as hours for some reason, you could
multiply it by 60 to get minutes, so:
MinutesWorked: [Minutes] - CLng((Nz([Break],0) * 60))
 
Thanks Allen, and thanks for the Calculating at your web site to, it works
great.
My database has a start time and finish time and I also have a column for
breaks, I just changed my calculations totals from hours.fraction so it reads
hours:minutes by using Allen Browns Calcuating Elapsed time and other info
for working past midnight (night shift) works fine.

This is what I have to change medium time to minutes:
Minutes: IIf(DateDiff("n",[Start],[Finish])<0,DateDiff("n",[Start],[Finish])
+1440,DateDiff("n",[Start],[Finish]))

My Break column is presently set to whole numbers, so I would enter 0.5 for
30 minutes.
What would I change this column to and how to work it in the formula or make
another column in the query to make it work where the break time is
subtracted from total minutes.

I thought of just making it total minutes on break like just entering 90
minutes for 1:30 (hour and half).
Would this be the best way?
 
Back
Top