Access semi-noob needs help with algorithm

L

Lawrencebenson

Alright, I am setting up an Access DB with 4 tables. EventInformation,
EmployeeInformation, TimeSheet, and Paygrade. I have run into a problem
though calculating shift pay for managers.

Normally, employees receive $10/hr for setup and $20/hr after the event
starts. So calculating hours looks something like this.

SetupHours:(DateDiff("n",[clock-in],[eventtime])/60)
EventHours:(DateDiff("n",[eventtime],[clock-out])/60)

For a manager though, they begin receiving Event pay 3 hours prior to
the Eventtime. I have a field called [managersetuphours] that holds the
variable under the TimeSheet Table. The [managersetuphours] cannot be
simply subtracted from the [eventtime]because sometimes [clock-in] is
often less then 3 hours from the event time.

Any ideas how to do this operation? I am completely stumped.


Thanks
 
M

Marshall Barton

Alright, I am setting up an Access DB with 4 tables. EventInformation,
EmployeeInformation, TimeSheet, and Paygrade. I have run into a problem
though calculating shift pay for managers.

Normally, employees receive $10/hr for setup and $20/hr after the event
starts. So calculating hours looks something like this.

SetupHours:(DateDiff("n",[clock-in],[eventtime])/60)
EventHours:(DateDiff("n",[eventtime],[clock-out])/60)

For a manager though, they begin receiving Event pay 3 hours prior to
the Eventtime. I have a field called [managersetuphours] that holds the
variable under the TimeSheet Table. The [managersetuphours] cannot be
simply subtracted from the [eventtime]because sometimes [clock-in] is
often less then 3 hours from the event time.


I think this will do that:

IIf(DateDiff("n", [clock-in],[eventtime]) >180, 180,
DateDiff("n", [clock-in],[eventtime]))
 
Top