Dim bd3 As New sqlCrossTableBuilder("统计表3", "报名缴费")
bd3.C
Dim dt3 As fxDataSource
bd3.HGroups.AddDef("所属分校")
bd3.VGroups.AddExp("缴费年月","CONVERT(varchar,year(缴费日期)) + '年' + Right(100+Month(缴费日期),2) + '月'")
bd3.Totals.AddDef("缴费编号", AggregateEnum.Count, "招生人数")
bd3.Totals.AddExp("续报人数","Case When 是否续报='续报' Then 1 Else 0 End") '对续报进行统计
bd3.Totals.AddDef("材料费", AggregateEnum.sum, "材料费")
bd3.Totals.AddDef("收费合计", AggregateEnum.sum, "收费合计")
bd3.Totals.AddExp("实收学费", "收费合计 - 材料费")
bd3.Filter = Filter1 & " And year(缴费日期)= '" & year.value & "' And month(缴费日期)= '" & month.value & "'"
根据上述代码生成表后,序的顺序理应是“所属分校”,“####年##月_招生人数”,“####年##月_续报人数”,“####年##月_材料费”,“####年##月_收费合计”,“####年##月_实收学费”,可是最终结果不是呢?
此主题相关图片如下:qq图片20180403175725.png