Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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 March 1st, 2004, 02:53 PM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Key based array in VBScript?

I have a table of rows and cols such as

Employee_Num Employee_Name
32587 Smith,John
65894 Jones,Tom
89652 Alias,Smith
32587 Smith,John

I need to wittle this list down to three unique employees. In VB I can do this easily with a collection using Employee_Num as a key. How can I do it with VBScript in ASP?

 
Old March 1st, 2004, 02:58 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Am I correct to assume this table is in a database? Why not have the database handler the selection of only unique rows?
 
Old March 1st, 2004, 03:58 PM
Registered User
 
Join Date: Oct 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The table is in a database however there is additional data in the rows that is not unique which needs to be looked at. However I need to make another query for each employee and want it to be unique.

 
Old March 1st, 2004, 06:05 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I'm not quite clear on what your response means, but it would seem to me that you just need to create the "unique employee" query and then the other query.

For your employee list, use this:

SELECT DISTINCT Employee_Num, Employee_Name FROM <employee table>

Peter
------------------------------------------------------
Work smarter, not harder.





Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional xslt processing based on java array twilson997 XSLT 7 June 28th, 2006 07:32 AM
traversing a tree based on an array of strings muki XSLT 1 February 16th, 2006 09:54 AM
Take the address of a stack based array Obnox BOOK: Professional C#, 2nd and 3rd Editions 1 April 21st, 2005 08:12 AM
return key based navigation VB 6.0 madhukp VB How-To 3 October 6th, 2004 04:32 AM
VBScript : alternative way of resizing an Array ? Sebastiaan Classic ASP Basics 3 September 9th, 2003 02:49 AM





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