If Then query help needed

This is a discussion on "If Then query help needed" within the Classic ASP section. This forum, and the thread "If Then query help needed are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Nov 17th, 2005, 14:24
New Member
Join Date: Nov 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
If Then query help needed

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
 %>
&nbsp; &nbsp; <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

Last edited by benbramz; Nov 20th, 2005 at 15:09.
Reply With Quote

Reply

Tags
then, query, help, needed

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nav bar query Scottie Starting Out 10 Jun 9th, 2008 21:23
query about my $query ziggi PHP Forum 9 Aug 10th, 2007 14:05
MySQL query query dangergeek Databases 3 Apr 12th, 2007 12:45
Query accessman Databases 0 Sep 22nd, 2005 19:48
ASP ADO SQL Query TheShadow Classic ASP 10 Jun 18th, 2005 15:12


All times are GMT. The time now is 21:03.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43