Foxtable(狐表)用户栏目专家坐堂 → 显示的结果,年是四位,format不管用呢?


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

主题:显示的结果,年是四位,format不管用呢?

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


加好友 发短信
等级:七尾狐 帖子:1765 积分:16651 威望:0 精华:0 注册:2017/6/1 23:12:00
显示的结果,年是四位,format不管用呢?  发帖心情 Post By:2018/3/3 8:42:00 [显示全部帖子]

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")

 回到顶部