Hi everybody, 
I have a database where I put timesheets information.
What I have done is a form where the user only has to input the [Start Time] and the [End Time] of a worker.
From there, I want the form to compute 5 figures:
-Note: while (4) and (5) are relatively straightforward, the first 3 ones seem very hard to me. -
But here is the trick: the definition of Normal/Overtime/Sunday hours isn't exactly the same for every job.
I initially started with If..Then..Else but I ended up with 4x4 conditions which I think is a hassle to redo for every job and different parameters.
Therefore, I want a function that would take in parameters like the defining times for Normal Hours, Overtime Hours and Sunday Hours, a given day Start Time and End Time, and return the actual Normal Hours, Overtime Hours and Sunday Hours.
Is there any way to do it more effectively?
Thanks for the hints
T
I have a database where I put timesheets information.
What I have done is a form where the user only has to input the [Start Time] and the [End Time] of a worker.
From there, I want the form to compute 5 figures:
(1) Normal hours = all daytime hours, for example from 8AM to 5PM
(2) Overtime hours (OT) = all overtime hours, for example from 5PM to 10PM
(3) Night Hours = for example 10PM to 8AM
(4) Sunday Hours = All Sunday Hours, from midnight to midnight.
(5) Holiday Hours
(2) Overtime hours (OT) = all overtime hours, for example from 5PM to 10PM
(3) Night Hours = for example 10PM to 8AM
(4) Sunday Hours = All Sunday Hours, from midnight to midnight.
(5) Holiday Hours
-Note: while (4) and (5) are relatively straightforward, the first 3 ones seem very hard to me. -
But here is the trick: the definition of Normal/Overtime/Sunday hours isn't exactly the same for every job.
I initially started with If..Then..Else but I ended up with 4x4 conditions which I think is a hassle to redo for every job and different parameters.
Therefore, I want a function that would take in parameters like the defining times for Normal Hours, Overtime Hours and Sunday Hours, a given day Start Time and End Time, and return the actual Normal Hours, Overtime Hours and Sunday Hours.
Is there any way to do it more effectively?
Thanks for the hints
T