anonymous
2011-05-11 15:07:57 UTC
I have what should be a simple question. I'm trying to build a simple database that tracks my employees' daily schedules and their vacation days. The end result I'm looking for is to be able to generate a report that says exactly who will be around on a given day. This report must take into account (a) their schedules (some employees work Monday - Friday; some work Sunday - Thursday, etc.) and (b) any vacation days or planned absences for the employee.
My records are currently structured as such:
I have one table that has a list of all employees' names, their start, end, break, and lunch times, and then a series of seven 'yes/no' fields--one for each day of the week--where I will check off each employees' schedules. For example, an employee that works Monday - Friday will have a check mark in the Monday field, the Tuesday field, the Wednesday field, etc.
I then have a second table that tracks employees' vacation days. I have created a relationship between the "full_name" field in each table.
So, the report I'm generating will have to do a number of things:
1) check to see what day of the week it is and store the value of the day's name in a variable
2) select the field that matches the contents of the variable, and pull any employee's name that has a 'yes' value in that field, meaning that they work that day.
3) for those employees, then scan through the vacation database and remove them from the list if they are on vacation that day.
4) for those employees that are on vacation, add them to a separate table.
The end result: a report that has a table of everyone who's in and another table of everyone who's out.
I can figure out SQL and VBA so I'm not asking you to build this thing for me. But would you be able to point me to any resources that would help me achieve this? Is this even possible?
Many thanks in advance for any help you can give.