Dim Jb17 As New SQLJoinTableBuilder("应付初数据1", "R04_TransformProducts_Detail")
Jb17.C
AddTable的表名不需要加大括号
Jb17.AddTable("R04_TransformProducts_Detail", "smartID", "R04_TransformProducts", "smartID", JoinModeEnum.Left)
Jb17.AddTable("R04_TransformProducts_Detail", "itemID", "R02_SilverStyle", "itemID", JoinModeEnum.Left)
Jb17.AddTable("R04_TransformProducts_Detail", "warehouseCode", "R02_Customer", "warehouseCode", JoinModeEnum.Left)
Jb17.AddExp("供应商代码", "{R02_Customer}.customerCode", True)
Jb17.AddExp("供应商名称", "{R02_Customer}.customerName", True)
Jb17.AddExp("本单日期", "convert(nvarchar(10),{R04_TransformProducts}.smartDate,121)", True)
Jb17.AddExp("系统单号", "{R04_TransformProducts}.smartID", True)
Jb17.AddExp("工费单号", "{R04_TransformProducts}.smartID", True)
Jb17.AddExp("领料单号", "{R04_TransformProducts}.smartID", True)
Jb17.AddExp("比较成色", "{R02_SilverStyle}.materialName", True)
Jb17.AddExp("实领料成色", "{R02_SilverStyle}.materialName", True)
'Jb17.AddExp("单据类型", "{R04_TransformProducts_Detail}.")没有指定列名
'Jb17.AddExp("类型", "领料重")不存在这些列
Jb17.AddExp("单内序号", "1")
Jb17.AddExp("产品成色", "''")
Jb17.AddExp("比较银重", "sum(isnull(weight,0))")少括号
Jb17.AddExp("比较工费", "0 * 0.00001")
Jb17.AddExp("产品件数", "0")
Jb17.AddExp("产品净银重", "0 * 0.00001")
Jb17.AddExp("备注", "''")
Jb17.AddExp("实领料银重", "sum(isnull(weight,0))")少括号
Jb17.AddExp("实工费", "0 * 0.00001")
Jb17.Filter = "{R02_SilverStyle}.materialTypeCode='01' and R02_Customer. customerCode='01.284' And {R04_TransformProducts}.audited = 'true' and convert(nvarchar(10),{R04_TransformProducts}.smartDate,121)>='2022-11-01' And convert(nvarchar(10),{R04_TransformProducts}.smartDate,121)<='2022-11-30'"
jb17.Build
MainTable = Tables("应付初数据1")
Tables("应付初数据1").visible = True