Last active
October 25, 2015 11:40
-
-
Save jocoonopa/2845dbc9db9c178cec49 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
LEFT(CONVERT(char(10), starttime, 112), 6) AS 月份, | |
RTRIM([AgentCD]) AS 人員代碼, | |
COUNT(DISTINCT([CustId])) AS 撥打會員數, | |
COUNT(TaskCD) AS 撥打通數, | |
SUM(DATEDIFF(second,StartTime,EndTime)) AS 撥打秒數, | |
COUNT(DISTINCT(day(starttime))) AS 工作日 | |
FROM CALLCENTER.dbo.CallLog | |
WHERE | |
custId NOT LIKE 'CT.' | |
AND starttime BETWEEN '$startDate' AND '$endDate' | |
GROUP BY LEFT(CONVERT(char(10), starttime, 112),6), AgentCD | |
ORDER BY LEFT(CONVERT(char(10), starttime, 112),6), AgentCD |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment