晕!
jiage=request("jiage")
if jiage=100 then
jiage1=300
elseif jiage=300 then
jiage1=500
elseif jiage=500 then
jiage1=700
elseif jiage=700
jiage1=1000
elseif jiage=1000
jiage1=1000
end if
select case action
case "1"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where name like '%"&searchkey&"%' and price2<="&jiage1&"and prince2>"&jiage&" and categoryid="&categoryid,conn,1,1
case "2"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2<="&jiage1&" and
prince2>"&jiage&" categoryid="&categoryid,conn,1,1
case "3"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where introduce like '%"&searchkey&"%' and price2<="&jiage1&" and prince2>"&jiage&" categoryid="&categoryid,conn,1,1
case "4"
rs.open "select id,name,mark,introduce,price1,price2,discount,detail,productdate from product where detail='"&searchkey&"' and price2<="&jiage1&" and prince2>"&jiage&" categoryid="&categoryid,conn,1,1
end select
else
'//分类为空。
select case action
case "1"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where name like '%"&searchkey&"%' and price2<"&jiage,conn,1,1
case "2"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2<"&jiage,conn,1,1
case "3"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where introduce like '%"&searchkey&"%' and price2<"&jiage,conn,1,1
case "4"
rs.open "select id,name,mark,introduce,price1,price2,discount,detail,productdate from product where detail='"&searchkey&"' and price2<"&jiage,conn,1,1
end select
dim strSql
strSql = "select id,name,mark,introduce,price1,price2,discount,productdate from product"
select case action
case "1"
strSql = strSql&" where name like '%"&searchkey&"%'"
case "2"
strSql = strSql&" where mark like '%"&searchkey&"%'"
case "3"
strSql = strSql&" where introduce like '%"&searchkey&"%'"
case "4"
strSql = strSql&" where name detail '%"&searchkey&"%'"
end select
select case jiage
case "100"
strSql = strSql&" and price2>100 and price2<300"
case "300"
strSql = strSql&" and price2>300 and price2<500"
case "500"
strSql = strSql&" and price2>500 and price2<700"
case "700"
strSql = strSql&" and price2>700 and price2<1000"
case "1000"
strSql = strSql&" and price2>1000"
end select
我把查询的这样改 还是不行~
select case action
case "1"
select case jiage
case "100"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["100"] and ["300"] and categoryid="&categoryid,conn,1,1
case "300"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["300"] and ["500"] and categoryid="&categoryid,conn,1,1
case "500"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["500"] and ["700"] and categoryid="&categoryid,conn,1,1
case "700"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["700"] and ["1000"] and categoryid="&categoryid,conn,1,1
case "1000"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2>"1000" and categoryid="&categoryid,conn,1,1
end select
case "2"
select case jiage
case "100"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["100"] and ["300"] and categoryid="&categoryid,conn,1,1
case "300"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["300"] and ["500"] and categoryid="&categoryid,conn,1,1
case "500"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["500"] and ["700"] and categoryid="&categoryid,conn,1,1
case "700"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["700"] and ["1000"] and categoryid="&categoryid,conn,1,1
case "1000"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2>"1000" and categoryid="&categoryid,conn,1,1
end select
case "3"
select case jiage
case "100"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["100"] and ["300"] and categoryid="&categoryid,conn,1,1
case "300"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["300"] and ["500"] and categoryid="&categoryid,conn,1,1
case "500"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["500"] and ["700"] and categoryid="&categoryid,conn,1,1
case "700"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["700"] and ["1000"] and categoryid="&categoryid,conn,1,1
case "1000"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2>"1000" and categoryid="&categoryid,conn,1,1
end select
case "4"
select case jiage
case "100"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["100"] and ["300"] and categoryid="&categoryid,conn,1,1
case "300"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["300"] and ["500"] and categoryid="&categoryid,conn,1,1
case "500"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["500"] and ["700"] and categoryid="&categoryid,conn,1,1
case "700"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2 between ["700"] and ["1000"] and categoryid="&categoryid,conn,1,1
case "1000"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2>"1000" and categoryid="&categoryid,conn,1,1
end select
end select
else
select case action
case "1"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where name like '%"&searchkey&"%' and price2<"&jiage&" and categoryid="&categoryid,conn,1,1
case "2"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2<"&jiage&" and categoryid="&categoryid,conn,1,1
case "3"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where introduce like '%"&searchkey&"%' and price2<"&jiage&" and categoryid="&categoryid,conn,1,1
case "4"
rs.open "select id,name,mark,introduce,price1,price2,discount,detail,productdate from product where detail='"&searchkey&"' and price2<"&jiage&" and categoryid="&categoryid,conn,1,1
end select
else
'//分类为空。
select case action
case "1"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where name like '%"&searchkey&"%' and price2<"&jiage,conn,1,1
case "2"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where mark like '%"&searchkey&"%' and price2<"&jiage,conn,1,1
case "3"
rs.open "select id,name,mark,introduce,price1,price2,discount,productdate from product where introduce like '%"&searchkey&"%' and price2<"&jiage,conn,1,1
case "4"
rs.open "select id,name,mark,introduce,price1,price2,discount,detail,productdate from product where detail='"&searchkey&"' and price2<"&jiage,conn,1,1
end select