以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  显示的结果,年是四位,format不管用呢?  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=115224)

--  作者:xxfoxtable
--  发布时间:2018/3/3 8:42:00
--  显示的结果,年是四位,format不管用呢?
Dim y,m,d As Integer
y=Date.Today.Year
m=Date.Today.Month
d=Date.Today.Day
Dim s As String
Dim xl As Integer = 0
For Each dr As DataRow In DataTables("订单表头").SQLSelect("[单号] like \'DD" & Format(y,"00") & Format(m,"00") & Format(d,"00") & "*\'")
    s=dr("单号")
    s=s.Replace("DD" & Format(y,"00") & Format(m,"00") & Format(d,"00") ,"")
    If xl <cint(s)
        xl=CInt(s)
    End If
Next
dr1("单号")="DD" & Format(y,"00") & Format(m,"00") & Format(d,"00")  & Format(xl+1,"0000")

--  作者:有点蓝
--  发布时间:2018/3/3 9:09:00
--  
dr1("单号")="DD" & Format(Date.Today,"yyMMdd") & Format(xl+1,"0000")