0
我想按分支和年份統計項目。 我試過這段代碼,但不起作用。任何幫助表示讚賞。如何按分支和年度sql服務器計數記錄
SELECT COUNT(ProjectIndentID) AS NoOfProjects, BranchID, DATEPART(year, PIDate) AS Expr1
FROM dbo.ProjectIndent
GROUP BY BranchID, PIDate
HAVING (DATEPART(year, PIDate) = '2016')