|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
我发现,其实8楼的人数计算结果是错误的,有重复计数。现修改语句如下:
select [Current Sub-team],[OT Year],[OT Month],[OT Date],[Total(Hours)],0 as 人数 from(
select b.[Current Sub-team],b.[Staff ID],a.[OT Year],a.[OT Month],a.[OT Date],a.[Total(Hours)] from [Current staff$]b left join [OT Record$]a on a.[Staff NO]=b.[Staff ID] where b.[Staff ID] is not null) union all
select [Current Sub-team],0,0,0,0,count([Staff ID]) as 人数 from [Current staff$] group by [Current Sub-team] |
|