以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  编码异常  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=141400)

--  作者:有点蓝
--  发布时间:2019/9/28 10:55:00
--  
和列长度没有什么关系。应该表格有些旧的不合规范的编码导致的

max = Tables("产品资料库").DataTable.SQLCompute("Max(开发项目编码)","建档日期 = \'" &  e.DataRow("建档日期") & "\' And [_Identify] <> " & e.DataRow("_Identify") & " and 开发项目编码 like \'CPKF%\'") \'取得该天的最大编号
            If max > "" Then \'如果存在最大编号
msgbox(max) ‘这里显示什么?
                idx = CInt(max.Substring(max.length - 3,3)) + 1 \'获得最大编号的后三位顺序号,并加1
            Else
                idx = 1 \'否则顺序号等于1
            End If