Dim bm As String = "统计表1"
Dim b As New SQLGroupTableBuilder(bm,"进销存表")
b.Groups.AddDef("车系")
b.Totals.AddExp("库龄分布_60天以下","IIF(库龄<60,1,0)")
b.Totals.AddExp("库龄分布_60天以上","IIF(库龄>=60 and 库龄<120,1,0)")
b.Totals.AddExp("库龄分布_120天以上","IIF(库龄>=120 and 库龄<150,1,0)")
b.Totals.AddExp("库龄分布_150天以上","IIF(库龄>=150 and 库龄<180,1,0)")
b.Totals.AddExp("库龄分布_180天以上","IIF(库龄>=180,1,0)")
b.Build
MainTable = Tables(bm)