GetRows! Or
Xml! Or with Dot.Net DataSets! David L. Penton, Microsoft MVP JCPenney Application Specialist / Lead "Mathematics is music for the mind, and Music is Mathematics for the Soul. - J.S. Bach" [EMAIL PROTECTED] Do you have the VBScript Docs or SQL BOL installed? If not, why not? VBScript Docs: http://www.davidpenton.com/vbscript SQL BOL: http://www.davidpenton.com/sqlbol -----Original Message----- From: Steve Abaffy [mailto:[EMAIL PROTECTED]] SQL = "Select * from CompanyTable order by CompanyName asc,ChosenPackage desc" This will return CompanyName ChosenPackage Big Book Shop 1 Freds Automotives 1 Kipper Shoppe 3 MacDonalds 3 MacDonalds 1 Sams Toilet Repair 2 Sams Toilet Repair 1 Wendys 2 THEN IN CODE CurrentCompany = "" While NOT RS.EOF IF CurrentCompany <> RS("CompanyName") 'Which it will not the first time Response.write RS("CompanyName") & " " & RS("ChosenPackage") CurrentCompany = RS("CompanyName") END IF RS.MoveNext WEND -----Original Message----- From: Craig [mailto:[EMAIL PROTECTED]] Here's the simplified version. Database with 2 fields, CompanyName and ChosenPackage where CompanyName is varchar and ChosenPackage is integer (1,2 0r 3). If a company upgrades from package 1 to package 2 or 3 I still want to retain the original record in the database so I might end up with a recordset like this: CompanyName ChosenPackage Freds Automotives 1 Big Book Shop 1 Sams Toilet Repair 1 Sams Toilet Repair 2 Kipper Shoppe 3 MacDonalds 1 Wendys 2 MacDonalds 3 I'll be using a WHILE NOT rs.EOF to print out all the records but in the case where there is more than one entry for a CompanyName I only want to include that CompanyName record where the ChosenPackage is of the highest value. In other words in this case I would want to exclude 2 records, MacDonalds 1 AND Sams Toilet Repair 1 Thanks. --- You are currently subscribed to activeserverpages as: [email protected] To unsubscribe send a blank email to [EMAIL PROTECTED]
