在MS Access中计算SQL

JT2*_*013 3 sql ms-access count

我有一个名为[Review Results]的表,看起来有点如下:

[Reviewed By]....[Review Date]....[Corrective Action]....[CAR]
John.............1/1/2011.........yes....................yes
John.............2/5/2011.........No.....................yes
John.............2/24/2011........yes....................yes
Bobby............1/1/2011.........No.....................No
Bobby............3/1/2011.........yes....................No  
Run Code Online (Sandbox Code Playgroud)

我试图显示[Corrective Action] = yes指定期间[CAR] = yes的评论者的数量以及指定期间的评论者的数量.我尝试使用以下SQL但它没有给出正确的输出:

select 
[Reviewed By],
Count(IIF([Corrective Action] = yes, 1,0)) as [CAMBRs],
Count(IIF([CAR] = yes,1,0)) as [CARs]

from [Review Results] 

where [Review Date]  between #1/1/2011# and #3/1/2011#

group by
[Reviewed By]  
Run Code Online (Sandbox Code Playgroud)

有人能用SQL指出我正确的方向吗?

Tej*_*eja 5

select 
[Reviewed By],
SUM(IIF([Corrective Action] = "yes", 1,0)) as [CAMBRs],
SUM(IIF([CAR] = "yes",1,0)) as [CARs]

from [Review Results] 

where [Review Date]  between #1/1/2012# and #3/1/2012#

group by
[Reviewed By]  
Run Code Online (Sandbox Code Playgroud)