查询每个月的纪录怎么写 sql语句阿

lcfgaoyong 2002-10-15 04:35:08
查询每个月的纪录怎么写 sql语句阿

<%@language=vbscript%>
<%
on error resume next
PostTime=now()
if len(year(PostTime))<=2 then
yearC="20" & year(PostTime)
else
yearC=year(PostTime)
end if
monthC=month(PostTime)

ptime=yearC&"/"&monthC&"/"&cstr(1)
qtime=yearC&"/"&monthC&"/"&cstr(31)
ptime=DateSerial(ptime)
qtime=DateSerial(qtime)
%>
<HTML>
<HEAD>
<TITLE> New Document </TITLE>

</HEAD>
<BODY bgcolor="#99FFFF" text="#3300CC">
<table>
<tr><td valign=top>查看月份纪录</td><td><form action="tishi2.asp?act=show" target= _blank method=post>
<select name=yearC>
<% for i = yearC-2 to yearC+2
if yearC = i then
Response.write "<option value="&i&" selected>"&i&"</option>"
else
Response.write "<option value="&i&">"&i&"</option>"
end if
next
%></select>年
<select name=monthC>
<% for i = 1 to 12
if monthC = i then
Response.write "<option value="&i&" selected>"&i&"</option>"
else
Response.write "<option value="&i&">"&i&"</option>"
end if
next
%></select>月
<input type=submit name=submit value="确定">
</form></td>
</tr>
</table>
<TABLE border=1 cellspacing=0 cellpadding=0 width=100% style="border-collapse: collapse; padding: 0" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#FFFFFF">
<TR align=center>
<td bgcolor=#0066CC><b><font color=#FFFFFF text=#ffffff>日期</font></b></td>
<%

constr = "DBQ="+server.mappath("fenxi.mdb") + ";DRIVER={Microsoft Access Driver (*.mdb)};"
set con = Server.Createobject("ADODB.Connection")
con.open constr
set rs=server.createObject("ADODB.Recordset")
Set rs1 = Server.CreateObject("ADODB.Recordset")
////问题在这里 sql="select * from fengxibaogao,fenxiyuan where fengxibaogao.unick=fenxiyuan.nicklist and fengxibaogao.adate????? order by fengxibaogao.adate desc,fenxiyuan.aid asc"
rs.Open sql, con, 1, 1

以上问号的地方怎么样替换???用select输入框获取要查找月份的纪录!谢谢!!!
...全文
71 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧