How to Get All Upline Managers of an Employee

  • Thread starter Thread starter pinktoed
  • Start date Start date
P

pinktoed

Guest
:confused:

Have the ff table
Employee with fields:
1. Emp ID
2. Emp Name
3. Manger Name

Want to retrieve the Manager before the General Manager and place this into field "Below GM"

Whats the best way to do this?

I have made query that will retrieve manager 1, manager 2 and so on until manager 7 of each employee. After this I was planning to make a criteria to select staring from manager 7 the name while the field is not null, when it is null, it will move to manager 6 and so on... But I cant seem tto figure out how to do Nested IIf 7 times..

Below GM: IIf([Man 1]![Man7] Is Not Null,[Man 1]![Man7],
IIf([Man 1]![Man6] Is Not Null,[Man 1]![Man6],
IIf([Man 1]![Man5] Is Not Null,[Man 1]![Man5]),
IIf([Man 1]![Man4] Is Not Null,[Man 1]![Man4]),
IIf([Man 1]![Man3] Is Not Null,[Man 1]![Man3]),
IIf([Man 1]![Man2] Is Not Null,[Man 1]![Man2]),
IIf([Man 1]![Man1] Is Not Null,[Man 1]![Man1]),'No Manager Defined'))

What do you think? Is this even possible? Any help would be great. Thanks!
 

Users who are viewing this thread

Back
Top Bottom