dbaker5204
Registered User.
- Local time
- Today, 15:23
- Joined
- Jan 19, 2018
- Messages
- 20
I have a query that is not grouping by Team. Currently it is grouping by Agent name, Supervisor, Date and it set to group by team, however, it is listing the teams separately. The Teams are linked to a table that lists the queue number and name, and the queue numbers and names are different for each, but shouldn't it still group if the team is the same? SQL is below:
SELECT [HelpDataNew Query].HelpDate, [HelpDataNew Query].AgentName, [HelpDataNew Query].Supervisor, [HelpDataNew Query].Team, Sum([HelpDataNew Query].ACDCalls) AS SumOfACDCalls, Sum([HelpDataNew Query].ACDTime) AS SumOfACDTime, Sum([HelpDataNew Query].ACWTime) AS SumOfACWTime, Sum([HelpDataNew Query].HoldTime) AS SumOfHoldTime, Sum([HelpDataNew Query].ExtInCalls) AS SumOfExtInCalls, Sum([HelpDataNew Query].ExtInTime) AS SumOfExtInTime, Sum([HelpDataNew Query].ExtOutCalls) AS SumOfExtOutCalls, Sum([HelpDataNew Query].ExtOutTime) AS SumOfExtOutTime, Sum([HelpDataNew Query].HeldCalls) AS SumOfHeldCalls, Sum([HelpDataNew Query].TransOutCalls) AS SumOfTransOutCalls, (IIf([ACDCalls]=0,0,([ACDTime]+[ACWTime]+[HoldTime])/[ACDCalls]))/86400 AS AHT2, [HoldTime]/86400 AS HOLDT, [ExtInTime]/86400 AS [InT], [ExtOutTime]/86400 AS OUTT
FROM [HelpDataNew Query]
GROUP BY [HelpDataNew Query].HelpDate, [HelpDataNew Query].AgentName, [HelpDataNew Query].Supervisor, [HelpDataNew Query].Team, (IIf([ACDCalls]=0,0,([ACDTime]+[ACWTime]+[HoldTime])/[ACDCalls]))/86400, [HoldTime]/86400, [ExtInTime]/86400, [ExtOutTime]/86400
HAVING (((Sum([HelpDataNew Query].ACDCalls))>0));
SELECT [HelpDataNew Query].HelpDate, [HelpDataNew Query].AgentName, [HelpDataNew Query].Supervisor, [HelpDataNew Query].Team, Sum([HelpDataNew Query].ACDCalls) AS SumOfACDCalls, Sum([HelpDataNew Query].ACDTime) AS SumOfACDTime, Sum([HelpDataNew Query].ACWTime) AS SumOfACWTime, Sum([HelpDataNew Query].HoldTime) AS SumOfHoldTime, Sum([HelpDataNew Query].ExtInCalls) AS SumOfExtInCalls, Sum([HelpDataNew Query].ExtInTime) AS SumOfExtInTime, Sum([HelpDataNew Query].ExtOutCalls) AS SumOfExtOutCalls, Sum([HelpDataNew Query].ExtOutTime) AS SumOfExtOutTime, Sum([HelpDataNew Query].HeldCalls) AS SumOfHeldCalls, Sum([HelpDataNew Query].TransOutCalls) AS SumOfTransOutCalls, (IIf([ACDCalls]=0,0,([ACDTime]+[ACWTime]+[HoldTime])/[ACDCalls]))/86400 AS AHT2, [HoldTime]/86400 AS HOLDT, [ExtInTime]/86400 AS [InT], [ExtOutTime]/86400 AS OUTT
FROM [HelpDataNew Query]
GROUP BY [HelpDataNew Query].HelpDate, [HelpDataNew Query].AgentName, [HelpDataNew Query].Supervisor, [HelpDataNew Query].Team, (IIf([ACDCalls]=0,0,([ACDTime]+[ACWTime]+[HoldTime])/[ACDCalls]))/86400, [HoldTime]/86400, [ExtInTime]/86400, [ExtOutTime]/86400
HAVING (((Sum([HelpDataNew Query].ACDCalls))>0));