Hello,
There are 2 issues involving searching one table called 'types'. I already have the db connection. I just cannot figure out how to write the query.
Fix #1: Display the word "All" when someone selects all types.
I need help building a
sql query to a table called 'types' based on a checkbox selection on a search form. The 'types' table contains 2 columns (TypeId with int of 4 and TypeName) there are 4 rows (Casualty, Health, Life, Pension). The search form is at
http://www.actuary.org/ce_calendar/buildSearch.asp. The Practice Area is where the 'types' are chosen. What I need to display is if someone chooses "All", the resulting display will be "All", not Casualty, Health, Life, Pension.
Fix #2: When someone chooses two or three types, display the results to include items where the chosen two or three types occur in one row, not just each individual occurrance in a single item. To see what I mean, test the search form via the url above by choosing two or three of the types and you'll see the issue.
The current code for the 'types' search is...
- Code: Select all
Sub buildPracticeArea()
'######### Get Data ################
getRecordSet "select typeId, typeName From Types order by typeName"
'######### iterate through data set write each type #############
do while not rs.eof
%>
<input type="checkbox" name="typeName" onclick="clearAll();" value="'<%=rs("typeName")%>'"> <%=rs("typeName")%>
<%
rs.moveNext
loop
'######### iteration complete ###############
rs.close
End Sub
The results page, has this to call it for display...
<%= rs("typeName")%>
Any assistance would be very much appreciated!
Anessa