03Explorer
Technical User
I have an ADP data dump that shows all associates in a company. With each associate there are two data points I am focusing on, their UniqueID (or AutoID ADP gives) and a ManagerID, which is the UniqueID of the associate that manages the associate in the row.
If I am a high level manager, my UniqueID is in the rows as manager for my direct reports. I want to build a list of all those below me at all levels, including the bottom person.
So if I am the Senior VP of a company, I want to build a list of all those below me... Directors (their direct reports), Managers (their direct reports), supervisors (their direct reports). With no one below the supervisors not having their ID as a manager, so we hit bottom.
Sample data
So if Frank Smith is logged into the system, Frank being EmployeeID (UniqueID) of 1, His list of people below him would include Everyone in the list above. However if Tina Bendricks(6) signs in, her list would be Jenifer Twitty and Hank Silver. But if Bethany Moore(2) signs in, her list would include Gill Sanderlyn, April Potter, Rose Forest, Lynn Smith and Tammy Wheeler.
I am not certain if I use VBA to loop through the ADP list or rather use SQL (Either TSQL or Access's SQL). My gut is telling me to use TSQL or Stored Procedure, but thought I'd start here in VBA land for questioning.
So the goal is to have a list of (not including self) but of all associates First and Last names so I can use them in a drop down for selecting.
Thanks for insight or conceptual ideas to help make this happen.
If I am a high level manager, my UniqueID is in the rows as manager for my direct reports. I want to build a list of all those below me at all levels, including the bottom person.
So if I am the Senior VP of a company, I want to build a list of all those below me... Directors (their direct reports), Managers (their direct reports), supervisors (their direct reports). With no one below the supervisors not having their ID as a manager, so we hit bottom.
Sample data
Code:
UniqueID LastName FirstName ManagerID Title
======== ======== ========= ========= =====
1 Smith Frank VP_Sales
2 Moore Bethany 1 Director_Sales
3 Williams Teddy 1 Director_Marketing
4 Sanderlyn Gill 2 Manager_Sales
5 Fredrick Todd 3 Manager_Marketing
6 Bendricks Tina 3 Manager_TradeShow
7 Potter April 4 Supervisor
8 Forest Rose 4 Supervisor
9 Black Ben 5 Supervisor
10 Twitty Jenifer 6 Supervisor
11 Smith Lynn 7 SalesCoordinator
12 Wheeler Tammy 8 SalesAdminAssistant
13 Getty Jeffery 9 MarketingCoordinator
14 Silver Hank 10 MarketingTradeShowAdminAssistant
I am not certain if I use VBA to loop through the ADP list or rather use SQL (Either TSQL or Access's SQL). My gut is telling me to use TSQL or Stored Procedure, but thought I'd start here in VBA land for questioning.
So the goal is to have a list of (not including self) but of all associates First and Last names so I can use them in a drop down for selecting.
Thanks for insight or conceptual ideas to help make this happen.