asp 自动编号问题

来源:百度知道 编辑:UC知道 时间:2024/05/23 05:00:09
在asp 中让其自动生成编号,格式为"日期加序号"
不通过数据库。来编号

dt=rs("datetimes")'是数据库中数据的datetime字段
bianhao=year(dt)&month(dt)&day(dt)&rs("id")
response.write bianhao

for i=1 to 30
bianhao=year(date())&month(date())&day(date())&i
response.write bianhao&"<br>"
next

再来个复杂一点的:
for i=1 to 30
bianhao=year(date())&right("0"&month(date()),2)&right("0"&day(date()),2)&right("0"&i,2)
response.write bianhao&"<br>"
next