Access semi-noob needs help with algorithm

  • Thread starter Thread starter Lawrencebenson
  • Start date Start date
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
 
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]))
 
Hanky said:
Where would I use this?


According to the syntax you used in your original post and
since this is the queries newsgroup, I would assume that
those are calculated fields in a query.
 
Back
Top