Dim Cols11() As String = {"供应商编号","品牌"}
Dim Cols12() As String = {"供应商编号","账务归属"}
Dim jb1 As New SQLJoinTableBuilder("未匹配供应商","面辅料采购入库汇总表")
jb1.C
jb1.AddTable("面辅料采购入库汇总表","供应商编号","业务财务供应商对应档案","供应商编号",JoinModeEnum.Left)
jb1.AddCols("{面辅料采购入库汇总表}.供应商编号","{面辅料采购入库汇总表}.供应商简称","用友供应商编号","账务归属","入库单含税总金额")
jb1.Filter = "入库单含税总金额 <> 0 and {面辅料采购入库汇总表}.供应商编号 <> 'Ml0372' and {面辅料采购入库汇总表}.品牌 <> '电商' and 登账日期 >= '" & dt01 & "' and 登账日期<= '" & dt02 & "'"
Dim jb2 As New SQLJoinTableBuilder("未匹配供应商","面辅料采购入库汇总表")
jb2.C
jb2.AddTable("面辅料采购入库汇总表",Cols11,"业务财务供应商对应档案",Cols12,JoinModeEnum.Left)
jb2.AddCols("{面辅料采购入库汇总表}.供应商编号","{面辅料采购入库汇总表}.供应商简称","用友供应商编号","账务归属","入库单含税总金额")
jb2.Filter = "入库单含税总金额 <> 0 and {面辅料采购入库汇总表}.供应商编号 <> 'Ml0372' and {面辅料采购入库汇总表}.品牌 = '电商' and 登账日期 >= '" & dt01 & "' and 登账日期<= '" & dt02 & "'"
jb1.Union(jb2,True)
jb1.Build()
结果发现面辅料采购入库汇总表中有但档案中没有的,并没有在未匹配供应商表中出现