不能分开写
Dim sql As String = "Select RcjBm,Mc,Rcjhl,Rcjhj FROM (SELECT Rcjid,Rcjhl,Rcjhj,fK From {QdxrcjhlMx} where Fk = '" & Tables("Qdmx").Current("Xh") & "') as a INNER JOIN {RcjhzMx} as b ON a.RcjId = b.RcjId"
Dim b As New GroupTableBuilder("统计表1",sql)
b.Groups.AddDef("RcjBm")
b.Groups.AddDef("Mc")
b.Groups.AddDef("Rcjhl")
b.Totals.AddDef("rcjhj")
'b.HorizontalTotal = True
b.VerticalTotal = True
b.Build()
MainTable = Tables("统计表1")