如何把多个查询结果直接组合在一起,不通过连接列
Dim jb As New SQLJoinTableBuilder("查询表1","日常废品录入")
jb.C
jb.AddExp("总废_数量","sum(废品数量)")
jb.AddExp("总废_数量","sum(废品数量)")
jb.AddExp("总废_重量","sum(废品总重)")
jb.Filter="{日常废品录入}.录入时间 between # " & dts & " # And # " & dte & "# and {日常废品录入}.生产线f In (" & s & ") and {日常废品录入}.材质规格f In (" & s1 & ")"
Dim fx As fxDataSource
fx=jb.BuildDataSource
Dim jb3 As New SQLJoinTableBuilder("查询表4","日常废品录入")
jb3.C
jb3.AddExp("内废_数量","sum(废品数量)")
jb3.AddExp("内废_重量","sum(废品总重)")
jb3.Filter="{日常废品录入}.录入时间 between # " & dts & " # And # " & dte & "# and {日常废品录入}.生产线f In (" & s & ") and {日常废品录入}.材质规格f In (" & s1 & ") and {日常废品录入}.发生工序 <> '成工退废' "
Dim fx3 As fxDataSource
fx3=jb3.BuildDataSource
Dim jb1 As New SQLJoinTableBuilder("查询表2","日常废品录入")
jb1.C
jb1.AddExp("外废_数量","sum(废品数量)")
jb1.AddExp("外废_重量","sum(废品总重)")
jb1.Filter="{日常废品录入}.录入时间 between # " & dts & " # And # " & dte & "# and {日常废品录入}.生产线f In (" & s & ") and {日常废品录入}.材质规格f In (" & s1 & ") and {日常废品录入}.发生工序 = '成工退废' "
Dim fx1 As fxDataSource
fx1=jb1.BuildDataSource
Dim jb2 As New SQLJoinTableBuilder("查询表3","生产统计表")
jb2.C
jb2.AddExp("生产总数_数量","sum(生产数量)")
jb2.AddExp("生产总重_重量","sum(生产总重)")
jb2.Filter="{生产统计表}.录入时间 between # " & dts & " # And # " & dte & "# and {生产统计表}.生产线s In (" & s & ") and {生产统计表}.材质规格s In (" & s1 & ")"
Dim fx2 As fxDataSource
fx2=jb2.BuildDataSource
jb2.Merge(jb) '组合jb2
jb2.Merge(jb1)
jb2.Merge(jb3)
Tables("废品分布图表分析_Table2").DataSource =jb.BuildDataSource
'Tables("废品分布图表分析_Table2").AutoSizeCols()