G
Guest
I have two tables that I need to create a query to do some calculations
between.
Table 1 Stores:
Employee ID, Vacation Time Allotted, Personal Time Allotted, and Holiday
Time Allotted
Example: Employee 123 has 140 hours of vacation, 40 hours of personal time,
and 88 hours of holiday time.
Table 2 Stores:
Employee ID, TimeType (Field that represents what kind of time the employee
took: vacation, personal, holiday), date, and the amount of time taken on
that day.
Example: Employee 123 took 8 hours of personal time on 6/12.
I need to find a way to add up the amount of time taken in each category and
then subtract that from their overall allotted time.
Example: Employee 123 has taken personal time on three occasions: once for 8
hours and twice for four hours.
I need to add up all personal time taken and subtract it from the 40 hours
that the company has allotted them so they know how much they have left.
My problem with this lies in the fact that "TimeType" (Holiday, Personal,
and Vacation time) are all stored in one field, where each allottment of time
is in a separate field.
Any ideas?
between.
Table 1 Stores:
Employee ID, Vacation Time Allotted, Personal Time Allotted, and Holiday
Time Allotted
Example: Employee 123 has 140 hours of vacation, 40 hours of personal time,
and 88 hours of holiday time.
Table 2 Stores:
Employee ID, TimeType (Field that represents what kind of time the employee
took: vacation, personal, holiday), date, and the amount of time taken on
that day.
Example: Employee 123 took 8 hours of personal time on 6/12.
I need to find a way to add up the amount of time taken in each category and
then subtract that from their overall allotted time.
Example: Employee 123 has taken personal time on three occasions: once for 8
hours and twice for four hours.
I need to add up all personal time taken and subtract it from the 40 hours
that the company has allotted them so they know how much they have left.
My problem with this lies in the fact that "TimeType" (Holiday, Personal,
and Vacation time) are all stored in one field, where each allottment of time
is in a separate field.
Any ideas?