Unanswered Question
Dec 23rd, 2009
User Badges:

Hello , i'me currently searching for a table contains historical data for IPCC DB per agent per log in period , not per half hour  or five minutes as existed .

the question  : Is there any table or join of tables contains historical data record for the agent for each login period(from the login to the logout date) , So i will get accurate data .? thanks,

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Tanner Ezell Mon, 12/28/2009 - 12:55
User Badges:
  • Silver, 250 points or more


You want the Agent State Detail table. Make a join based on two tables, one table which is the login, and one table which is the logout. Join the two based on agentID and any other conditions you require.

Example of login table:

SELECT agentID, eventDateTime AS loginTime, eventType

                FROM dbo.AgentStateDetail AS ASD1

                JOIN dbo.Resource AS r ON ASD1.agentID = r.resourceID

                WHERE eventType = 2 AND r.dateInactive >= @startDateTime

Example of logout table:

SELECT agentID, eventDateTime AS logoutTime, eventType

                FROM dbo.AgentStateDetail AS ASD2

                JOIN dbo.Resource AS r ON ASD2.agentID = r.resourceID

                WHERE eventType = 3 AND r.dateInactive >= @startDateTime

Join the two, do a date diff and you'll have the duration between the two states. In this example, ready/notready times. Change eventType to suit your needs.


This Discussion