Foxtable(狐表)用户栏目专家坐堂 → [求助]Substring问题


  共有2319人关注过本帖树形打印复制链接

主题:[求助]Substring问题

帅哥哟,离线,有人找我吗?
hahahehe21
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:幼狐 帖子:92 积分:1856 威望:0 精华:0 注册:2014/4/11 21:10:00
[求助]Substring问题  发帖心情 Post By:2019/1/27 16:39:00 [显示全部帖子]

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编辑过]

 回到顶部