I have written a macro which shows management structure in my company from the Top manager to simple employees.
The database Table looks like this that: I have one column Emplid which includes all employees in the company (Top manager, management and simple employees). Next columns are Last Name, First name of the employees. One column with Supervisor ID (Managers) which each employee has. Next column is HR Status where I have a information if a employee is still active or on Leave and Absence or International Assignment and Terminated or deceased.
I want that my macro will show the whole structure but only employees who have the status Active and Leave on Absence and International Assignment.
The Terminated and deceased shouldn't be in the extract.
Like here: Top manager--> Only Active Directors ---> Only active managers ---> Only active team leaders ---> only active Supervisors --> Only active employees.
The issue is that I want to use a SQL query and I don't know how to bite this.
I'm using a Excel Workbook as a Data Base.
I have created such macro but I'm weak in SQL and I don't know how to write good the query to get what I want.
Thank you for your help!
Bookmarks