> Hi. Sorry for the delay.
>
[quoted text clipped - 16 lines]
> > suggestions on how I could manipulate this code to account for work hours?
> > Have you had anyone ask about this before? I appreciate any help on this.
It sounds like you just want to subtract 1 hour from the daily total to
account for lunch. Am I close? If so, there are two possibilities. If lunch
doesn't always last an hour, you could add an extra field where users can
enter the amount of minutes they spent having lunch and then subtract this
amount from the total when performing the calculation. If lunch always lasts
an hour, you could just modify the formula to subtract 1 hour (=3600
seconds). You could change the formula for the rule on the startTime to
something like
(((number(substring(../my:endTime, 1, 2)) * 3600) +
(number(substring(../my:endTime, 4, 2)) * 60)) - ((number(substring(., 1, 2))
* 3600) + (number(substring(., 4, 2)) * 60)) - lunchTime) div 3600
where you should replace lunchTime with the value 3600 or with the field
containing the amount of minutes for lunch multiplied by 60, so use something
like
(((number(substring(../my:endTime, 1, 2)) * 3600) +
(number(substring(../my:endTime, 4, 2)) * 60)) - ((number(substring(., 1, 2))
* 3600) + (number(substring(., 4, 2)) * 60)) - 3600) div 3600
for the static 1-hour lunch case, or
(((number(substring(../my:endTime, 1, 2)) * 3600) +
(number(substring(../my:endTime, 4, 2)) * 60)) - ((number(substring(., 1, 2))
* 3600) + (number(substring(., 4, 2)) * 60)) -
(number(../my:lunchTimeInMinutes * 60))) div 3600
for the dynamic amount of minutes for lunch entered by the user.
---
S.Y.M. Wong-A-Ton
> I do want to calculate the amount of hours between two given times on one
> day. The work hours that I need to calculate on are 8:30 - 17:30 and when
[quoted text clipped - 22 lines]
> > > suggestions on how I could manipulate this code to account for work hours?
> > > Have you had anyone ask about this before? I appreciate any help on this.