Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
New Member

busy hour SQL query

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

4 REPLIES
Green

Re: busy hour SQL query

UCCE or UCCX? I have a UCCE query.

Regards,

Geoff

New Member

Re: busy hour SQL query

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

Green

Re: busy hour SQL query

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

New Member

Re: busy hour SQL query

Cool, thanks.

782
Views
0
Helpful
4
Replies
CreatePlease to create content