Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms 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 July 9th, 2003, 09:33 AM
Authorized User
 
Join Date: Jul 2003
Posts: 41
Thanks: 0
Thanked 1 Time in 1 Post
Default multiple select menus from distinct fields

I put this in another section...but I think it really should go here.

I have a access db with 4 different fields I need to get distinct info from. Each field has hundreds of duplicates...I want to get the distinct values for each column or field and put them in dropdown menus.

This is easy to do for one field or column.

<%
    sSQL = "SELECT DISTINCT Fund" & _
           " FROM MASTER_TABLE_cfoapal2" &_
           " ORDER BY Fund"
    set rs = Connect.Execute(sSQL)
%>
<snip>------------
<select name="dropdown1">
<% Do until rs.eof %>
 <option><%=rs("Fund")%></option>
<% rs.MoveNext
   Loop %>
</select>

I don't know how to do it for multiple fields...
I can't use SQL = "SELECT DISTINCT Fund" DISTINCT Org, because it gives me an error message. I also can't use sSQL = "SELECT Fund, Org", because I get hundreds of multiple entries for each of the two dropdowns.

How do I do this?
Do you need more information?


 
Old March 18th, 2004, 12:47 PM
Registered User
 
Join Date: Mar 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you found a solution to this? I have something similar.

sqlDrop1="SELECT ID,Manufacturer,Model FROM products"
sqlDrop1=sqlDrop1 & " WHERE Manufacturer LIKE '" & TOC & "'"
sqlDrop1=sqlDrop1 & " ORDER BY Model"

I want the ability to select the distinct of the model and only list one of each of the models in the above query. Currently, the above will show all the models (including duplicates).

[email protected]






Similar Threads
Thread Thread Starter Forum Replies Last Post
Select Distinct? [email protected] SQL Language 5 November 5th, 2005 09:58 AM
Distinct SELECT DISTINCT question... EndEffect Classic ASP Databases 4 August 18th, 2005 08:53 AM
three independant select menus nancy Javascript How-To 4 December 14th, 2004 11:36 AM
select distinct bmains ADO.NET 0 April 8th, 2004 02:50 PM
Distinct fields from mult columns abbylee26 Classic ASP Basics 4 March 18th, 2004 12:47 PM





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