asp学习网: 首页 >> 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

from:asp学习网/title:asp自定义函数:生成包含日期的订单号的代码/ time:2006-11-9 22:58:41

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

asp教程 ©2006-2007 aspxuexi.com | 关于站点 | 版权隐私 | 站内搜索
复制或者翻版 请于夜间进行