|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
以下是月均加班时间语句:
select a.[Current Sub-team],a.[OT Year],a.[OT Month],a.[Total(Hours)],b.人数 from
(select [Current Sub-team],[OT Year],[OT Month],sum([Total(Hours)]) as [Total(Hours)] from(select b.[Current Sub-team],b.[Staff ID],a.[OT Year],a.[OT Month],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) group by [Current Sub-team],[OT Year],[OT Month])a
left join (select [Current Sub-team],count([Staff ID]) as 人数 from [Current staff$] group by [Current Sub-team])b on a.[Current Sub-team]=b.[Current Sub-team]
[ 本帖最后由 抹香鲸2009 于 2010-6-11 12:55 编辑 ] |
|