cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements

162
Views
10
Helpful
3
Replies
Highlighted
Beginner

Total Number of Active Agents in an Agent Team

We have several configured Agents in several Agent Teams. I am looking to run a query on total agents in each agent teams who have recently logged in so we can eliminate some of the old configured agents. Any ideas? 

1 ACCEPTED SOLUTION

Accepted Solutions
Enthusiast

Re: Total Number of Active Agents in an Agent Team

Here we go, look for LastLoginTime to find agents who have logged in recently.

 

SELECT DISTINCT P.FirstName, P.LastName, P.LoginName, MAX(AED.LoginDateTime) AS LastLoginTime, Agent_Team_Member.AgentTeamID, Agent_Team.EnterpriseName
FROM Agent A, Agent_Event_Detail AED, Person P, Agent_Team_Member, Agent_Team
WHERE A.SkillTargetID = AED.SkillTargetID
and Agent_Team_Member.AgentTeamID = Agent_Team.AgentTeamID
and A.SkillTargetID = Agent_Team_Member.SkillTargetID
AND A.PersonID = P.PersonID
GROUP BY P.FirstName, P.LastName, P.LoginName, Agent_Team_Member.AgentTeamID, Agent_Team.EnterpriseName
ORDER BY LastLoginTime desc

 

 

3 REPLIES 3
Enthusiast

Re: Total Number of Active Agents in an Agent Team

Here we go, look for LastLoginTime to find agents who have logged in recently.

 

SELECT DISTINCT P.FirstName, P.LastName, P.LoginName, MAX(AED.LoginDateTime) AS LastLoginTime, Agent_Team_Member.AgentTeamID, Agent_Team.EnterpriseName
FROM Agent A, Agent_Event_Detail AED, Person P, Agent_Team_Member, Agent_Team
WHERE A.SkillTargetID = AED.SkillTargetID
and Agent_Team_Member.AgentTeamID = Agent_Team.AgentTeamID
and A.SkillTargetID = Agent_Team_Member.SkillTargetID
AND A.PersonID = P.PersonID
GROUP BY P.FirstName, P.LastName, P.LoginName, Agent_Team_Member.AgentTeamID, Agent_Team.EnterpriseName
ORDER BY LastLoginTime desc

 

 

Beginner

Re: Total Number of Active Agents in an Agent Team

Thank you very much Piyush, you are the best. Appreciate all your help.
Enthusiast

Re: Total Number of Active Agents in an Agent Team

You're welcome :-)

CreatePlease to create content
Content for Community-Ad
August's Community Spotlight Awards