11-22-2010 06:10 AM - edited 03-14-2019 06:55 AM
Anyone have a SQL query that I can run to see our busy hour stats? I'm looking to see when we have the most agents logged in and how many are actually logged in. Someone sent me this a long time ago and I'm searching all my emails but havent' found it yet. Hoping someone out there may have it. I swear someone from Cisco sent it to me, but they are the ones asking for this info. Long story, don't ask.
Thanks,
paul
11-22-2010 07:40 AM
UCCE or UCCX? I have a UCCE query.
Regards,
Geoff
11-22-2010 07:43 AM
It's UCCE, sorry. I actually found it after another hour of searching. Here's what I'm running....
DECLARE @BeginDate Varchar(30), @EndDate Varchar(30)
SELECT @BeginDate = '10/25/10',
@EndDate = '10/26/10'
PRINT '****************************************************************************'
PRINT 'Agent Licenses: Preferred Calculation if Agent Level Reporting is turned on'
PRINT '****************************************************************************'
SELECT AHHAdjustedCount = MAX(AHHCount.AdjustedLoggedOn)
FROM (SELECT DateTime,
AgentsLoggedOn = Count(*),
AdjustedLoggedOn = Ceiling(SUM(LoggedOnTimeToHalf)/1800.0)
FROM Agent_Half_Hour AS AHH,
Media_Routing_Domain AS MRD
WHERE DateTime >= @BeginDate
AND DateTime < @EndDate
AND AHH.MRDomainID = MRD.MRDomainID
AND MRD.MediaClassID IN (3,4)
GROUP BY DateTime) AHHCount
11-22-2010 09:42 AM
Almost exactly. It came to me from Paige Delk, and I tweaked it a bit.
declare @start datetime
declare @end datetime
set @start = '2010/10/18 0:00'
set @end = DATEADD(dd, 1, @start)
SELECT AHHAdjustedCount = MAX(AHHCount.AdjustedLoggedOn)
FROM (SELECT DateTime,
AgentsLoggedOn = Count(*),
AdjustedLoggedOn = Ceiling(SUM(LoggedOnTimeToHalf)/1800.0)
FROM Agent_Half_Hour AS AHH
WHERE DateTime >= @start
AND DateTime < @end
AND AHH.MRDomainID = 1
GROUP BY DateTime) AHHCount
Regards,
Geoff
11-22-2010 09:51 AM
Cool, thanks.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide