现在我用的日期是70101,麻烦给位老师帮看看怎么才能改成20070101的格式,先谢谢了
<html>
<body background="cabg038.jpg">
<div align="center">
<p><b><font face="黑体" size="6" color="#FF0000">商品查询</font></b></p>
<table border=1 height="51" bordercolor="#000000" cellspacing="1" bordercolorlight="#000000" bgcolor="#33CCFF" width="940">
<%
date1=request.form("g11111111")
date2=request.form("g22222222")
y1=mid(date1,4,1)
if len(cstr(month((CDate(date1)))))=1 then
m1="0"+cstr(month((CDate(date1))))
else
m1=cstr(month((CDate(date1))))
end if
if len(cstr(day((CDate(date1)))))=1 then
d1="0"+cstr(day((CDate(date1))))
else
d1=cstr(day((CDate(date1))))
end if
ymd1=y1 & m1 & d1
y2=mid(date2,4,1)
if len(cstr(month((CDate(date2)))))=1 then
m2="0"+cstr(month((CDate(date2))))
else
m2=cstr(month((CDate(date2))))
end if
if len(cstr(day((CDate(date2)))))=1 then
d2="0"+cstr(day((CDate(date2))))
else
d2=cstr(day((CDate(date2))))
end if
ymd2=y2 & m2 & d2
response.write "数据查询生成时间为:" & date1 & "至" & date2
response.write "<br>"
Set OBJConn = Server.CreateObject("ADODB.Connection")
OBJConn.Open "jysu","1","123456"
sersql="select chdrnum,sl,zackupdt from ipe_rtrn a where sl_date between '" & ymd1 & "' and '" & ymd2 & "'
Set rs=OBJConn.Execute (sersql)
%>