Sorry, still not clear. I suggest to write out the rules. Or write out the logic for each record.
For the first record, SHEE34, their manager is DAVID. The Access UIDs are for SHEE34, their manager, and lead staff ID.
Same rule for the second record.
For the third record, DAVID22, both SHEE34 and ANJ343 are included in Access UIDs, I guess because David is there manager.
What would the row for Kay look like?
What would the row for Kay's manager look like?
How many levels of nesting are there?
The Boston Area SAS Users Group is hosting
free webinars!
Next up:
Bart Jablonski and I present 53 (+3) ways to do a table lookup on Wednesday Sep 18.
Register now at
https://www.basug.org/events.