![]() |
#2
hubowei2012-12-25 07:41
|

<select name="price">
<option value="0" selected>均价不限</option>
<option value="1">2000以下</option>
<option value="2">2000-2500</option>
<option value="3">2500-3000</option>
<option value="4">3000-4000</option>
<option value="5">4000-5000</option>
<option value="6">5000-6000</option>
<option value="7">6000-7000</option>
<option value="8">7000以上</option>
</select>
search.asp
<%
price=RtnReplaceInt(Request("price"),0)
Select case price
Case 1
Price2=2000
Case 2
Price1=2000
Price2=2500
Case 3
Price1=2500
Price2=3000
Case 4
Price1=3000
Price2=4000
Case 5
Price1=4000
Price2=5000
Case 6
Price1=5000
Price2=6000
Case 7
Price1=6000
Price2=7000
Case 8
Price1=7000
End Select
Sql="select * from NewHouse where sh='1' and len(HouseName)>2 "&citysql&" "
If Price1<>"" then
Sql=Sql&" and avgprice>="&price1&""
End If
If Price2<>"" Then
Sql=Sql&" and avgprice<="&price2&""
End if
Sql=Sql&" order by dateandtime desc"
rs.Open Sql,conn,1,3
if rs.eof and rs.bof then
response.write "<br><li>暂无楼盘!</li>"
else
%>
这个是不是可以进行区间价格查询?<option value="0" selected>均价不限</option>
<option value="1">2000以下</option>
<option value="2">2000-2500</option>
<option value="3">2500-3000</option>
<option value="4">3000-4000</option>
<option value="5">4000-5000</option>
<option value="6">5000-6000</option>
<option value="7">6000-7000</option>
<option value="8">7000以上</option>
</select>
search.asp
<%
price=RtnReplaceInt(Request("price"),0)
Select case price
Case 1
Price2=2000
Case 2
Price1=2000
Price2=2500
Case 3
Price1=2500
Price2=3000
Case 4
Price1=3000
Price2=4000
Case 5
Price1=4000
Price2=5000
Case 6
Price1=5000
Price2=6000
Case 7
Price1=6000
Price2=7000
Case 8
Price1=7000
End Select
Sql="select * from NewHouse where sh='1' and len(HouseName)>2 "&citysql&" "
If Price1<>"" then
Sql=Sql&" and avgprice>="&price1&""
End If
If Price2<>"" Then
Sql=Sql&" and avgprice<="&price2&""
End if
Sql=Sql&" order by dateandtime desc"
rs.Open Sql,conn,1,3
if rs.eof and rs.bof then
response.write "<br><li>暂无楼盘!</li>"
else
%>
我数据库的表是NewbCn_Fule
需要查询的的数据位这个?
怎么弄呢?
[ 本帖最后由 playstar 于 2012-12-24 19:30 编辑 ]