Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old March 1st, 2004, 02:53 PM
Registered User
 
Join Date: Oct 2003
Location: , , .
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?

Reply With Quote
  #2 (permalink)  
Old March 1st, 2004, 02:58 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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?
Reply With Quote
  #3 (permalink)  
Old March 1st, 2004, 03:58 PM
Registered User
 
Join Date: Oct 2003
Location: , , .
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.

Reply With Quote
  #4 (permalink)  
Old March 1st, 2004, 06:05 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 11:03 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.