asp 按日期查找
<%
'阶段查询
Dim d1,d2
d1 = request.form(datevalue1)
d2 = request.Form(datevalue2)
sql = "select count(ID) from [c_User] where RegisterDate > = ' "& d1 & " ' and RegisterDate <= ' "& d2 & " ' "
%>
<form method= 'submit ' name= 'mainform ' id= "mainform ">
<table width= "665 " border= "0 ">
<tr>
<td width= "266 " style= "padding-left:30px; "> 开始日期:
<input type= "text " name= 'datevalue1 ' size= "10 " maxlength= "10 "/>
</td>
<td width= "283 " style= "padding-left:10px; "> 结束日期:
<input type= "text " name= 'datevalue2 ' size= "10 " maxlength= "10 " />
</td>
<td width= "102 ">
<input type= "submit " name= "Submit " value= "提交查 "action= "R.asp "/>
</td>
</tr>
</table>
</form>
为什么不对??求教
------解决方案--------------------去查datediff的用法
你这种比较会有太大的出入的。
------解决方案--------------------d1,d2的格式要正确. 是怎样的格式?