access中支持COUNT([Total_Score])=0这样的计数方法,但是对于sql server这样的方法是报错的;sql server用case when可以实现相同的功能
SELECT COUNT( case when datediff(hour,[Created_Date],GETDATE())>=8 then 'over8' end) as 'over8',COUNT( case when (datediff(hour,[Created_Date],GETDATE())>=0 and datediff(hour,[Created_Date],GETDATE())<4) then 'over8' end) as '0-4' FROM SIT.dbo.CaseSubmit