Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 13th, 2006, 04:41 PM
Registered User
 
Join Date: Mar 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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

--------------------------------------------------------------------
 
Old January 19th, 2006, 02:38 AM
Registered User
 
Join Date: Mar 2004
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry guys but I figured it out. I changed my sql code just a bit to look like this example:
Code:
If Request("MinBSF") > "0" Then
sql = sql & " AND BuildingSquareFeet >= '" & trim(Request("MinBSF")) & "' "
Else
End If





Similar Threads
Thread Thread Starter Forum Replies Last Post
error displaying asp page tanca Classic ASP Basics 5 November 28th, 2007 02:29 AM
Displaying XML format on ASP page GS ASP.NET 2.0 Basics 1 August 31st, 2007 08:33 PM
passing values from ASP page to a popup ASP Page astrosmurfboy Classic ASP Basics 3 April 21st, 2004 08:17 PM
Can Access accept a Null from an ASP web page? kaytrina Classic ASP Databases 5 March 20th, 2004 07:11 PM
displaying charts on an ASP page vik_asp Classic ASP Basics 1 August 6th, 2003 01:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.