ASP page not displaying null values
Hey guys,
I have a search page on a project which works fine. The page size is set to 10 on the result page. After choosing "Next Page" the number of records drops because of null values. Please, how can I fix it?
My search page is at yakiyak.brinkster.net/mls.htm. For City select "Kissimmee", leave all others blank. It should say 1995 records, then click "Next Page" it'll drop to 770 records. The fields that sometimes contain null values are: MinBSF, MinAcres, and YearBuilt.
My SQL Query -------------------------------------------------------
sql = "SELECT * FROM Midfl_data WHERE PropertyCode = '" & trim(Request("PropertyCode")) & "' AND CityCode IN ('" & trim(CityCode) & "')"
sql = sql & " AND Price >= " & trim(Request("StartPrice")) & " "
sql = sql & " AND Price <= " & trim(Request("EndPrice")) & " "
sql = sql & " AND Bedrooms >= '" & trim(Request("MinBeds")) & "' "
sql = sql & " AND Bathrooms >= '" & trim(Request("MinBaths")) & "' "
If Request("MinBSF") = "0" Then
Else
sql = sql & " AND BuildingSquareFeet >= '" & trim(Request("MinBSF")) & "' "
End If
If Request("MinAcres") = "0" Then
Else
sql = sql & " AND Acres >= '" & trim(Request("MinAcres")) & "' "
End If
If Request("YearBuilt") = "0" Then
Else
sql = sql & " AND YearBuilt >= '" & trim(Request("YearBuilt")) & "' "
End If
sql = sql & "Order by Price"
rs.open sql, oConn, 1, 1
--------------------------------------------------------------------
The "Next Page" code -----------------------------------------------
<%If Request("MinBSF") = "0" Then%><%Else%>
&MinBSF=<%= Request("MinBSF") %><%End If%>
<%If Request("MinAcres") = "0" Then%><%Else%>
&MinAcres=<%= Request("MinAcres") %><%End If%>
<%If Request("YearBuilt") = "0" Then%><%Else%>
&YearBuilt=<%= Request("YearBuilt") %><%End If%>
&Page=<%= nPage + 1 %>">Next Page
--------------------------------------------------------------------
|