物流调度员工作内容:大家看看ASP问题

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 09:36:35
dim getday,leixing
getday=cint(request.Form("getday"))
leixing=cint(request.Form("leixing"))
thisday=dateadd("d",-getday,now)
select case leixing
case 1
conn.execute("delete from [question] where jinghua=0 and [time]<"&thisday)
end select

错误类型:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] 语法错误 (操作符丢失) 在查询表达式 'jinghua=0 and [time]<2005-12-9 23:42:48' 中。
/zhuye/jinanxuexi/wenda/wenda/dellot.asp, 第 10 行

SQL语句不对。日期型应该加上界定符#
delete from [question] where jinghua=0 and [time]<#"&thisday & "#"

如果是ACCESS数据库:delete from [question] where jinghua=0 and [time]<#"&thisday & "#"
如果是SQLSERVER:delete from [question] where jinghua=0 and [time]<'"&thisday & "'"

time错了吧,可能是类型不匹配,改改2005..后面的,最好用你数据库里面的函数转换一下,先加个'2005-12-9 23:42:48'试试,不行就查下资料