Foxtable(狐表)用户栏目专家坐堂 → [求助] 如何判断格式化日期


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

主题:[求助] 如何判断格式化日期

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


加好友 发短信
等级:贵宾 帖子:39310 积分:196782 威望:0 精华:1 注册:2015/4/25 9:23:00
  发帖心情 Post By:2016/8/10 17:52:00 [显示全部帖子]

'序列号
Dim tb As String  = args(0) '表名称
Dim lb As String  = args(1) '类别
Dim ws As Integer = 0 '位数
Dim rq As String  = Format(Date.Today,"yyyyMMdd")
Dim xlh As String '序列号
Dim cmd As New SQLCommand
Dim sql As String =""
Dim dt As DataTable
cmd.ConnectionName = "chiplinksys"
sql="select top 1 * fr om " & tb & "  where isdeleted = 0 order by _identify desc"
cmd.CommandText = sql
dt = cmd.ExecuteReader()
Dim rtval As String =""
If dt.DataRows.Count > 0 Then
    xlh = dt.DataRows(0)("订单编号")
    If rq = xlh.SubString(lb.length, 8)
        ws = lb.Length + 8
        xlh = xlh.SubString(ws)
        rtval = lb & rq & format(CInt(xlh) + 1, "0000")
    Else
        rtval = lb & rq & "0001"
    End If
Else
    rtval = lb & rq & "0001"
End If
Return rtval


 回到顶部