Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Removing duplicates from lists
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

sogoth
New Member

United Kingdom
73 Posts

Posted - 23 July 2001 :  09:48:24  Show Profile  Visit sogoth's Homepage
Hi

If there a simple way to populate a drop down list from a database and ignore duplicate items?

for example a contact address book will probably contain more than one person living in the same town. You wouldn't really want to put all occurances of the town in the dropdown list.

Any idea?

thanks

Paul -
Complete Muppet, Borderline Feeble!

Spoon
Average Member

Ireland
507 Posts

Posted - 23 July 2001 :  12:26:02  Show Profile  Visit Spoon's Homepage  Send Spoon an ICQ Message
quote:

Hi

If there a simple way to populate a drop down list from a database and ignore duplicate items?

for example a contact address book will probably contain more than one person living in the same town. You wouldn't really want to put all occurances of the town in the dropdown list.

Any idea?

thanks

Paul -
Complete Muppet, Borderline Feeble!



There is an easier way. In your database make seperate fields. Refering back to your example, you could make the following fields.

Name
Address
Town
City
Country

Then just search through them and populate your list e.g

WHAT_TOWN = Request.Form("TOWN")

SQL = "Select * From TABLENAME where Town like '%" & WHAT_TOWN & "%' ORDER BY Name"

populate your dropdownlist

Hope this helps,


Regards,

Spoon, (ya all love me right?)
Go to Top of Page

sogoth
New Member

United Kingdom
73 Posts

Posted - 03 August 2001 :  06:47:38  Show Profile  Visit sogoth's Homepage
Kinda what's in there, but I found the SQl command that I needed to sort the problem

SELECT DISTINCT city
FROM address
ORDER BY city

thanks for the help though

Paul -
Complete Muppet, Borderline Feeble!
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07