50分求对高手来说很简单的代码~~~
查 询 保 单 列 表
出单日期:() -- ()
保单号:()
被保险人:()
起保日期:() --()
系统部门:()
实际部门:()
业务员:()
谁能帮忙写下根据上面表单来进行查询的asp代码,只要以上任何一个字段值符合就能从数据库中查询数据。我就懂一点点asp
下面是我自己写的一点点查询语句,肯定有很多错误,请高手指点下
dim Date11,Date12,DBnumber,Person1,Date21,Date22,SysDepar,Person2,Money
set rs=server.createobject( "adodb.recordset ")
Date11=trim(request( "date11 "))
Date12=trim(request( "date12 "))
DBnumber=trim(request( "number "))
Person1=trim(request( "persone1 "))
Date21=trim(request( "date21 "))
Date22=trim(request( "date22 "))
SysDepart=trim(request( "depart1 "))
FactDepart=trim(request( "depart2 "))
Person2=trim(request( "person2 "))
Money=trim(request( "money "))
if Date11 <> " " then
if not isdate(Date11) then
response.write " <script language= 'javascript '> "
response.write "alert( '您填写的内容不符合要求,必须是日期,请检查! '); "
response.write "location.href= 'javascript:history.go(-1) '; "
response.write " </script> "
response.end
end if
if Date12 <> " " then
if not isdate(Date12) then
response.write " <script language= 'javascript '> "
response.write "alert( '您填写的内容不符合要求,必须是日期,请检查! '); "
response.write "location.href= 'javascript:history.go(-1) '; "
response.write " </script> "
response.end
end if
if Date21 <> " " then
if not isdate(Date21) then
response.write " <script language= 'javascript '> "
response.write "alert( '您填写的内容不符合要求,必须是日期,请检查! '); "
response.write "location.href= 'javascript:history.go(-1) '; "
response.write " </script> "
response.end
end if
if Date22 <> " " then
if not isdate(Date22) then
response.write " <script language= 'javascript '> "
response.write "alert( '您填写的内容不符合要求,必须是日期,请检查! '); "
response.write "location.href= 'javascript:history.go(-1) '; "
response.write " </script> "
response.end
end if
if Date11 <> " " and Date12 <> " " then
sql = sql + "select * from wifeII where outdate between # "&Date11& "# and # " &Date12& "# "
if DBnumber <> " " then
sql = sql + "and number = '% " &DBnumber& " '% "
if Person1