| | |
problems selecting minimum when searching
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2004
Posts: 4
Reputation:
Solved Threads: 0
I am trying to select the number of rooms from my database but want it so the user can select a minimum or exact number.
This is a snippet of the code on my search page
<tr><td>Number Of Bedrooms:
<td>
<SELECT NAME="REQUIREMENT">
<OPTION VALUE="AL">Minimum</OPTION>
<OPTION VALUE="EX">Exactly</OPTION>
</SELECT>
<select name="Bedrooms" size="1">
<option selected value="">-</option>
<option value="2">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></td></tr>
This is a snippet of the code on my results page
IF Bedrooms <> "" THEN
SELECT CASE Requirement
CASE "AL" Bedrooms = Bedrooms + "and BEDROOMS >=" & BEDROOMS
CASE "EX" Bedrooms = Bedrooms + "and BEDROOMS =" & BEDROOMS
END SELECT
END IF
If Bedrooms <> "" Then
WhereClause = WhereClause & "Bedrooms = " & _
Bedrooms & " AND "
End If
Please help If you need more information please just ask i'm really strugling with this one.
Cheers
This is a snippet of the code on my search page
<tr><td>Number Of Bedrooms:
<td>
<SELECT NAME="REQUIREMENT">
<OPTION VALUE="AL">Minimum</OPTION>
<OPTION VALUE="EX">Exactly</OPTION>
</SELECT>
<select name="Bedrooms" size="1">
<option selected value="">-</option>
<option value="2">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select></td></tr>
This is a snippet of the code on my results page
IF Bedrooms <> "" THEN
SELECT CASE Requirement
CASE "AL" Bedrooms = Bedrooms + "and BEDROOMS >=" & BEDROOMS
CASE "EX" Bedrooms = Bedrooms + "and BEDROOMS =" & BEDROOMS
END SELECT
END IF
If Bedrooms <> "" Then
WhereClause = WhereClause & "Bedrooms = " & _
Bedrooms & " AND "
End If
Please help If you need more information please just ask i'm really strugling with this one.
Cheers
![]() |
Similar Threads
- pc problem (Windows NT / 2000 / XP)
- Summarizing excel workbooks (VB.NET)
- changed my processor (Motherboards, CPUs and RAM)
- Finally (Community Introductions)
- Php Sessions (PHP)
- MATRIX algebra pracice problem solved (C++)
- audio problems (Windows Vista and Windows 7)
- Malware posing as a program and messing with IE6? Ideas? (Viruses, Spyware and other Nasties)
- Boot Disks (Viruses, Spyware and other Nasties)
Other Threads in the ASP Forum
- Previous Thread: Creating ASP with ASP
- Next Thread: "ADODB Recordset error"
Views: 2632 | Replies: 0
| Thread Tools | Search this Thread |
Tag cloud for ASP
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection calendar changeable connection current database databaseconnection diagnostics dreamweaver excel fso html iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile query record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit update web webserver windows7





