Asp教程

通过asp实例结合结合ACCESS,MSSQL来更好的深入Asp学习 - 爬坡者

« asp绝对有用的函数收集返回指定数目的从字符串的左边算起的字符 »

生成包含日期的订单号的asp自定义函数

此函数,用于生成流水号.

sub subcode
dim startyear
dim startmon
dim startday
dim code
startyear = <%=year(now())%>
startmon = <%=month(now())%>
startday = <%=day(now())%>
if startmon<10 then
startmon="0"&month(date)
end if
if startday<10 then
startday="0"&day(date)
end if
if startyear&startmon&startday<>left(<%=(rs_newcode.Fields.Item("maxer").Value)%>,8) then
code=001
else
code=int(mid(<%=(rs_newcode.Fields.Item("maxer").Value)%>,9,3))+1
end if
if len(code)=1 then
code="00"&cstr(code)
end if
if len(code)=2 then
code="0"&cstr(code)
end if
Form1.goods_code.value = startyear & startmon&startday&cstr(code)
end sub


asp自定义函数:生成包含日期的订单号的代码

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Spirit Build 80710

Copyright 2007-2008 papozhe.com [asp教程] All Rights Reserved.
浙ICP备07030537号
免责申明:所有文章除特别声明,均来自网上,主要为学习用!内容仅供参考,版权归原作者。如侵犯您利益,请来信告知.
Email:papozhe$Gmail.com QQ:76336503