照搬代码如下:
Dim bd1 As New CrossTableBuilder("统计表1",sql1, "c")
Dim dt1 As fxDataSource
bd1.HGroups.AddDef("FWORKSHOPID") '根据型号分组
bd1.HGroups.AddDef("FNAME")
bd1.VGroups.AddDef("FDATE",DateGroupEnum.Month,"{0}月")
bd1.Totals.AddDef("FREALQTY","入库数量") '对数量进行统计
'bd1.Totals.AddDef("金额","进货_金额") '对金额进行统计
dt1 = bd1.BuildDataSource()
Dim bd2 As New CrossTableBuilder("统计表2",sql2, "cl")
Dim dt2 As fxDataSource
bd2.HGroups.AddDef("FWORKSHOPID") '根据型号分组
bd2.VGroups.AddDef("FDATE",DateGroupEnum.Month,"{0}月")
bd2.Totals.AddDef("FUNQUALIFIEDQTY","不合格数量") '对数量进行统计
dt2 = bd2.BuildDataSource()
'
'Dim nms As String() = {"FWORKSHOPID","{0}月"} '指定连接列
Dim nms As String() = {"FWORKSHOPID"} '指定连接列
dt1.Combine(nms,dt2,nms)
'dt1.Combine("FWORKSHOPID",dt2,"FWORKSHOPID")
Tables("窗口_Table1").DataSource = dt1
请问如何写代码将两个表 按照日期合并到一起?现有代码只能简单将两个结果合并连接到一起,不能按照日期{0}月分别显示结果

此主题相关图片如下:企业微信截图_15335156138763.png

[此贴子已经被作者于2018/8/6 8:34:15编辑过]