Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
New Member
Posts: 6
Registered: ‎03-28-2012

I need help with a Query to get a managers name and all of their direct reports

What I am trying to do is create a report that takes the userid of the person runing the report and pulls in all of the userid/username that reports to the person running the report.

Highlighted
Nickel Contributor
Posts: 56
Registered: ‎10-26-2010

Re: I need help with a Query to get a managers name and all of their direct reports

SELECT [USERID]
FROM [USERSECURITY] WHERE MANAGERID = {ManagerId}

New Member
Posts: 6
Registered: ‎03-28-2012

Re: I need help with a Query to get a managers name and all of their direct reports

Thanks

But what I am struggling with is getting the actual names for a report.


@CollinCampbell wrote:

SELECT [USERID]
FROM [USERSECURITY] WHERE MANAGERID = {ManagerId}


 

Nickel Contributor
Posts: 56
Registered: ‎10-26-2010

Re: I need help with a Query to get a managers name and all of their direct reports

SELECT US.[USERID]
,US.[USERCODE]
,UI.USERNAME
FROM [USERSECURITY] US JOIN [USERINFO] UI ON US.USERID = UI.USERID
WHERE MANAGERID = {ManagerId}