高手帮忙看看这段asp代码搜索部分什么地方有错
运行环境,asp能正常读取access中的数据myuser字段为经手人属性为文本,sdate字段为日期属性为日期时间不搜索就正常,搜索就报错错误代码如下,高手帮忙改正一下...
运行环境,asp能正常读取access中的数据
myuser字段为经手人属性为文本,sdate字段为日期属性为日期时间
不搜索就正常,搜索就报错
错误代码如下,高手帮忙改正一下
<%
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from xsck "
myuser=request("myuser")
date1=request("date1")
date2=request("date2")
Dim SearchSQL
If myuser <> "" Then
SearchSQL = SearchSQL & " and myuser like '%" & myuser & "%'"
End If
If IsDate(date1) Then
SearchSQL = SearchSQL & " and Datediff('s','" & date1 & "',sdate) > -1"
End If
If IsDate(date2) Then
SearchSQL = SearchSQL & " and Datediff('s','" & date2 & "',sdate) < 1"
End If
sql="select * from xsck " & SearchSQL & " order by id desc,id desc"
rs.open sql,conn,1 展开
myuser字段为经手人属性为文本,sdate字段为日期属性为日期时间
不搜索就正常,搜索就报错
错误代码如下,高手帮忙改正一下
<%
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from xsck "
myuser=request("myuser")
date1=request("date1")
date2=request("date2")
Dim SearchSQL
If myuser <> "" Then
SearchSQL = SearchSQL & " and myuser like '%" & myuser & "%'"
End If
If IsDate(date1) Then
SearchSQL = SearchSQL & " and Datediff('s','" & date1 & "',sdate) > -1"
End If
If IsDate(date2) Then
SearchSQL = SearchSQL & " and Datediff('s','" & date2 & "',sdate) < 1"
End If
sql="select * from xsck " & SearchSQL & " order by id desc,id desc"
rs.open sql,conn,1 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询