我试图按月总结这些数据的结果......而不是个别日期。我该怎么做?
SELECT DISTINCT
CONVERT (DATETIME, CONVERT (VARCHAR (10), SignInDateTime, 101)) AS Appended_SignInDate,
GO.GeographicLocationDescription,
COUNT(DISTINCT acd.EmployeeID) as Total_FTL
FROM
dbACD.Detail.vwRockwellEventAgentPerformance AS ACD
LEFT OUTER JOIN
dbEmployee.Summary.vwEmployeeHistory AS EH
ON acd.employeeID = eh.EmployeeID
AND ACD.SignOutDateTime Between eh.StartDate and eh.EndDate
LEFT OUTER JOIN
dbEmployee.Config.vwGeographicLocation AS GO
ON EH.GeographicLocationID = GO.GeographicLocationID
WHERE
ACD.SignOutDateTime BETWEEN '2012-06-01' AND '2013-03-31'
-- AND ACD.SignoutReasonCode ='4'
AND GO.GeographicLocationDescription is not null
GROUP BY
CONVERT (DATETIME, CONVERT (VARCHAR (10), SignInDateTime, 101)),
GO.GeographicLocationDescription
ORDER BY
CONVERT (DATETIME, CONVERT (VARCHAR (10), SignInDateTime, 101)),
GO.GeographicLocationDescription