Dim jb As New SQLJoinTableBuilder("白卡纸用量查询表","PNumPaperInfo")
jb.C
jb.AddTable("PNumPaperInfo","PaperID","mstock","MaterialID")
jb.AddTable("PNumPaperInfo","PNum","PNumSumInfo","PNum")
jb.AddExp("克重", "SubString({PNumPaperInfo}.PaperName,1,4)")
jb.AddExp("规格", "SubString({PNumPaperInfo}.PaperName.")
jb.AddCols("{PNumSumInfo}.InDate","{PNumSumInfo}.PNum","{PNumSumInfo}.Customer","{PNumPaperInfo}.Product","{PNumPaperInfo}.PartsName","{mstock}.Band","{PNumPaperInfo}.PaperName","{PNumPaperInfo}.Scale","{PNumPaperInfo}.CalUnit","{PNumPaperInfo}.SrcCount","{mstock}.SumCount","{mstock}.MSubType","{PNumPaperInfo}.ID")
jb.Filter = "{PNumSumInfo}.InDate >= '1/1/2018' AND {PNumSumInfo}.InDate <= '12/31/2019' and {mstock}.MSubType = '白卡纸'and {mstock}.Band <> '海龙'"
jb.Order = "{PNumPaperInfo}.ID DESC"
jb.Distinct = True
jb.Build()
MainTable = Tables("白卡纸用量查询表")
PaperName的值如“250克博汇丹顶鹤白卡卷筒787mm”、“260克北极豹白卡卷筒787mm”
想获取后面5个字符“787mm”作为列“规格”
如何修改代码?
[此贴子已经被作者于2019/1/27 16:41:12编辑过]