两个表 部门考勤和调休表,单独统计都行得通:
Dim Filter As String
Dim curD As Date = #9/30/2014#
Dim lastD As Date = curD.AddMonths(-1) '上一个月的日期
Dim lastD2 As New Date(lastD.Year, lastD.Month, Date.DaysInMonth(lastD.Year,lastD.Month)) '上个月的最后一天
Filter = Filter & "考勤日期 > #" & lastD2 & "#" & " And 考勤日期 <= #" & curD & "#"
Dim b As New SQLGroupTableBuilder("统计表1","部门考勤")
b.C
B.Groups.AddDef("{部门考勤}.考勤日期",DateGroupEnum.Year,"年") '
b.Groups.AddDef("{部门考勤}.考勤日期","月") '
b.Groups.AddDef("{部门考勤}.部门") '
b.Groups.AddDef("姓名")
b.Totals.AddDef("出勤")
b.Filter = Filter
b.Build
Dim Filter As String
Dim curD As Date = #9/30/2014#
Dim lastD As Date = curD.AddMonths(-1) '上一个月的日期
Dim lastD2 As New Date(lastD.Year, lastD.Month, Date.DaysInMonth(lastD.Year,lastD.Month)) '上个月的最后一天
Filter = Filter & "考勤日期 > #" & lastD2 & "#" & " And 考勤日期 <= #" & curD & "#"
Dim b As New SQLGroupTableBuilder("统计表1","调休表")
b.C
B.Groups.AddDef("{调休表}.考勤日期",DateGroupEnum.Year,"年") '
b.Groups.AddDef("{调休表}.考勤日期","月") '
b.Groups.AddDef("{调休表}.部门") '
b.Groups.AddDef("姓名")
b.Totals.AddDef("调休结余")
b.Filter = Filter
b.Build