« ActionScript 3.0 概要Exp 函数 »

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

原创文章如转载,请注明:转载自悠悠博客 [ http://www.ajaxstu.com/ ]

相关文章:

发表评论:

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