asp按时间查询..

来源:百度知道 编辑:UC知道 时间:2024/05/17 05:33:13
<!--#include file="../#function/data_conn.asp"-->
<%
'下面这俩语句一个是从URL取今天日期,下面注释掉的是直接取当天日期
jintian = request("today")
'jintian = date()
%>
<%
set rs=server.createobject("adodb.recordset")
sqltext="select (field16) as sumfield16 from sheet where intime between #"&jintian&" 00:00:00# and #"&jintian&" 23:59:59#"
rs.open sqltext,conn,1,1
if rs.eof then
response.write "0"
else
response.write "" & rs("sumfield16")
end if
%>

想以日期为条件查询ACCESS数据库sheet表里面field16字段,这段代码只能够显示一条,想加个循环,把所有符合条件的field16里面的数据都调出来
请高手帮忙...
题目写错了,不是按时间查询,是按日期查询,数据库里面的日期是:2008-1-1 13:25:26形式的.

搂主看下这段代码行不:
<!--#include file="../#function/data_conn.asp"-->
<%
'下面这俩语句一个是从URL取今天日期,下面注释掉的是直接取当天日期
jintian = request("today")
'jintian = date()
jintian = FormatDateTime(jintian,2)
%>
<%
set rs=server.createobject("adodb.recordset")
sqltext="select (field16) as sumfield16 from sheet where FormatDateTime(intime,2)=#"&jintian&"#"
rs.open sqltext,conn,1,1
if rs.eof then
response.write "0"
else
response.write "" & rs("sumfield16")
end if
%>