流水号问题

lihuigoeasy 2012-11-28 01:28:17
高分求助 谁能告诉 系统当前日期加四位流水号怎么写
...全文
145 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
lzp4881 2012-11-28
  • 打赏
  • 举报
回复
<% Function Get_NewId() dim today : today = date() dim toyear : toyear = year(today)*10000 dim tomonth : tomonth = month(today)*100 dim tonow : tonow = day(today) Get_NewId = toyear + tomonth + tonow sqlstr = "Select ListID from paylist where left(ListID,8)='" & Get_NewId & "'" Set rs = Conn.Execute(sqlstr) If rs.EOF Then Get_NewId = Get_NewId*10000+1 Else Get_NewId = rs("listid")*1+1 End If rs.close set rs = nothing End Function %>
lzp4881 2012-11-28
  • 打赏
  • 举报
回复
<% Function Get_NewId() dim today : today = date() dim toyear : toyear = year(today)*10000 dim tomonth : tomonth = month(today)*100 dim tonow : tonow = day(today) Get_NewId = toyear + tomonth + tonow sqlstr = "Select ListID from paylist where left(ListID,8)='" & Get_NewId & "'" Set rs = Conn.Execute(sqlstr) If rs.EOF Then Get_NewId = Get_NewId*10000+1 Else Get_NewId = rs("listid")*1+1 End If End Function %>
lihuigoeasy 2012-11-28
  • 打赏
  • 举报
回复
在这基础上怎么改 <% Function Get_NewId() dim today today=date() toyear=year(today) toyear=toyear*10000 tomonth= month(today) tomonth=tomonth*100 tonow=day(today) Get_NewId = toyear + tomonth + tonow Get_NewId = Get_NewId*10000+1 sqlstr = "Select ListID from paylist order by ListID" Set rs = Conn.Execute(sqlstr) If Not rs.EOF Then While Not rs.EOF Get_NewId = toyear + tomonth + tonow Get_NewId = Get_NewId*10000+1 Get_NewId = rs("listid") rs.MoveNext Wend Get_NewId = Get_NewId + 1 Else Get_NewId = Get_NewId End If End Function %>
Dogfish 2012-11-28
  • 打赏
  • 举报
回复
no=year(now) & right(100+month(now),2) & right(100+day(now),2) & right(100+hour(now),2) & right(100+minute(now),2) & +right(100+second(now),2) & "流水号"
lihuigoeasy 2012-11-28
  • 打赏
  • 举报
回复
应该怎么写啊
lzp4881 2012-11-28
  • 打赏
  • 举报
回复
Get_NewId = rs("listid") ... Get_NewId = Get_NewId + 1 你从数据库里面取数据,日期当然不会变了
lihuigoeasy 2012-11-28
  • 打赏
  • 举报
回复
帮我看看哪写错啦 第二天日期不变 <% Function Get_NewId() dim today today=date() toyear=year(today) toyear=toyear*10000 tomonth= month(today) tomonth=tomonth*100 tonow=day(today) Get_NewId = toyear + tomonth + tonow Get_NewId = Get_NewId*10000+1 sqlstr = "Select ListID from paylist order by ListID" Set rs = Conn.Execute(sqlstr) If Not rs.EOF Then While Not rs.EOF Get_NewId = toyear + tomonth + tonow Get_NewId = Get_NewId*10000+1 ' rs("ListID").value=Get_NewId Get_NewId = rs("listid") rs.MoveNext Wend 'Get_NewId = toyear + tomonth + tonow 'Get_NewId = Get_NewId*10000 Get_NewId = Get_NewId + 1 Else Get_NewId = Get_NewId End If End Function %>
Go 旅城通票 2012-11-28
  • 打赏
  • 举报
回复
那不直接&上你的流水号就行了?。。。
no=year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&"流水号"

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧