为什么我的ACCESS数据库时间对比查询老是出错啊?
zc806 2004-12-04 10:38:07 str=""
if StartDate<>"" then str=str & "and pay_time>='" & StartDate & "' "
if EndDate<>"" then str=str & "and pay_time<='" & EndDate & "' "
if UserName<>"" then str=str & "and userid like '%" & UserName & "%' "
if Money<>"" then str=str & "and money "& Operation &" " & Money & " "
if guanli<>"" then str=str & "and admin_user = '" & guanli & "' "
if queren<>"" then str=str &" and fangshi= '" & queren & "'"
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
SQL = "SELECT * FROM pay_log where pay_zt=true " & str & "ORDER BY id DESC"
Recordset1.open sql,conn,1,1
-----------------------------------------------------------------
这段是我定义的查询要求
if StartDate<>"" then str=str & "and pay_time>='" & StartDate & "' "
if EndDate<>"" then str=str & "and pay_time<='" & EndDate & "' "
-------------------------------------------------------------------
但是为什么老是不行呢?而且还使得CUP给100%占用呢,郁闷~
时间对比查询要怎么定义才是最快界的啊?希望高手指教一下小弟!