randomdude
New member
- Local time
- Today, 00:10
- Joined
- Sep 30, 2009
- Messages
- 3
I'm currently designing a database to track headcount and headcount changes for a building of roughly 1500 employees (advisors) and I've run into some issues.
Getting a total headcount of employees under each manager is easy, I just count the records of employee id's and group by manager name, but I'm having a problem making this data work with employee changes. I have a table called [advisor changes] that tracks an employees id if they go on a project or a loan to another dept for instance.
So if employee A goes on a project from team A to team B for a certain time frame, like 9/1/09-10/5/09 then that means Team A is temporarily losing an employee and team B is gaining one. When a project is entered a start and end date are also entered for that record.
The problem is I can't find a way to show total headcount by month where I can take the total employee headcount and then add anyone joining for a project and subtract anyone leaving for a project. I can get a total BUT not by month, and this is where my question comes in.
When I get total employee headcount by counting every employee's id, this is in no way tied to a month. Because of this I can't get the query to work where I get a monthly total by taking employee headcount and subtracting employees on project for the dates they were gone. Employees being added or subtracted have dates associated with them, but counting an employee id has no date associated with it.
I don't know if this is a query problem or a table problem, but I'm thinking there should be a way to design the tables to make it work.
Ultimately what I'd like to generate is a report saying something like for September team A had 50 employees, they gained 1 on project and lost two so they had a total of 49 employees for September. and I need to do that for every month so we can track it for the year.
Any help would be greatly appreciated.
Getting a total headcount of employees under each manager is easy, I just count the records of employee id's and group by manager name, but I'm having a problem making this data work with employee changes. I have a table called [advisor changes] that tracks an employees id if they go on a project or a loan to another dept for instance.
So if employee A goes on a project from team A to team B for a certain time frame, like 9/1/09-10/5/09 then that means Team A is temporarily losing an employee and team B is gaining one. When a project is entered a start and end date are also entered for that record.
The problem is I can't find a way to show total headcount by month where I can take the total employee headcount and then add anyone joining for a project and subtract anyone leaving for a project. I can get a total BUT not by month, and this is where my question comes in.
When I get total employee headcount by counting every employee's id, this is in no way tied to a month. Because of this I can't get the query to work where I get a monthly total by taking employee headcount and subtracting employees on project for the dates they were gone. Employees being added or subtracted have dates associated with them, but counting an employee id has no date associated with it.
I don't know if this is a query problem or a table problem, but I'm thinking there should be a way to design the tables to make it work.
Ultimately what I'd like to generate is a report saying something like for September team A had 50 employees, they gained 1 on project and lost two so they had a total of 49 employees for September. and I need to do that for every month so we can track it for the year.
Any help would be greatly appreciated.