Hi,
I have a table with:
employeenum|managernum|managerlevel
A single employee reports to one manager, and then there is chain. I am trying to figure out the top level managernum for an employee, being that the manager level is corporateitmanager.
Example:
EmployeeNum|Managernum|managerlevel
0000123 1111123 ITManager
1111123 2222123 RegionalITManager
2222123 3333123 CorpITManager
So the end result I am looking for is that the employeenum 0000123 CorpITManager is 3333123.
There are multiple RegionalITMAnagers, and multiple CorpITManager's. I am trying to get results that show the employeenum, and the managernum for the corpitmanager for that employee, so I can determine the number of employees reporting to the different corpitmanagers, and therenames.
I can't figure out the statement to use,it seems really complex. Can someone please help me. Thanks
I have a table with:
employeenum|managernum|managerlevel
A single employee reports to one manager, and then there is chain. I am trying to figure out the top level managernum for an employee, being that the manager level is corporateitmanager.
Example:
EmployeeNum|Managernum|managerlevel
0000123 1111123 ITManager
1111123 2222123 RegionalITManager
2222123 3333123 CorpITManager
So the end result I am looking for is that the employeenum 0000123 CorpITManager is 3333123.
There are multiple RegionalITMAnagers, and multiple CorpITManager's. I am trying to get results that show the employeenum, and the managernum for the corpitmanager for that employee, so I can determine the number of employees reporting to the different corpitmanagers, and therenames.
I can't figure out the statement to use,it seems really complex. Can someone please help me. Thanks