偶写一个个搜索,其中一个条件是时间,如1天前,3天前,15天前,30天前等等。
但我写的ASP代码却执行不了,一执行IIS就挂了。请达人帮忙看一下,应该怎么写才对。
Page=Request("Page")
if Cint(Page)=0 then
Page=1
If Request("KeyWord")<>"" then
KeyWord=Trim(Request("KeyWord"))
flag=Cint(Request("flag"))
session("KeyWord")=KeyWord
session("flag")=flag
if flag = 1 then
sql="select * from Company_Invite where CompanyName Like '%"&KeyWord&"%'"
elseif flag = 2 then
sql="select * from Company_Invite where Position Like '%"&KeyWord&"%'"
end if
else
Response.Write("<script>alert('请输入关键字!');window.location.href='index.asp'</script>")
Response.End
end if
if Request("Position")<>"all" then
PType=CInt(Request("Position"))
Session("Position")=PType
sql=sql&" and PositionType="&PType
else
PType="all"
Session("Position")=PType
end if
'if Request("Date")<>"all" then
' Date=CInt(Request("Date"))
' Sql=" and datediff('d',[AddTime],getdate()))<"&Date&""
'End if
elseif Cint(Page)>=1 then
KeyWord=Session("KeyWord")
flag=Session("flag")
PType=session("Position")
if flag = 1 then
sql="select * from Company_Invite where CompanyName Like '%"&KeyWord&"%'"
elseif flag = 2 then
sql="select * from Company_Invite where Position Like '%"&KeyWord&"%'"
end if
if PType<>"all" then
sql=sql&" and PositionType="&PType
end if
End if
红色的那段就是,请达人指点,谢谢!