ASP 101 - Active Server Pages 101 - Web04
The Place ASP Developers Go!

Please visit our partners


Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates














ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash





Script Output:

SQL Query: SELECT * FROM [sales] ORDER BY [SalesmanId] desc, [Amount] desc;

SalesmanId (+ / -) Timestamp (+ / -) Amount (+ / -)
27 7/23/2002 11:43:00 AM 2450
27 7/24/2002 11:43:00 AM 2050
26 7/24/2002 11:43:00 AM 3000
26 7/23/2002 11:43:00 AM 2580
25 7/23/2002 11:43:00 AM 2100
25 7/24/2002 11:43:00 AM 1690
24 7/24/2002 11:43:00 AM 2400
24 7/23/2002 11:43:00 AM 565
23 7/24/2002 11:43:00 AM 4000
23 7/23/2002 11:43:00 AM 980
22 7/24/2002 11:43:00 AM 4000
22 7/23/2002 11:43:00 AM 420
21 7/24/2002 11:43:00 AM 4000
21 7/23/2002 11:43:00 AM 750
20 7/24/2002 11:43:00 AM 3220
20 7/23/2002 11:43:00 AM 3150
19 7/23/2002 11:43:00 AM 3210
19 7/24/2002 11:43:00 AM 2655
18 7/23/2002 11:43:00 AM 2610
18 7/24/2002 11:43:00 AM 1355
17 7/24/2002 11:43:00 AM 3500
17 7/23/2002 11:43:00 AM 1320
16 7/24/2002 11:43:00 AM 2710
16 7/23/2002 11:43:00 AM 1340
15 7/24/2002 11:43:00 AM 4810
15 7/23/2002 11:43:00 AM 1900
14 7/24/2002 11:43:00 AM 3245
14 7/23/2002 11:43:00 AM 1100
13 7/24/2002 11:43:00 AM 1390
13 7/23/2002 11:43:00 AM 1360
12 7/24/2002 11:43:00 AM 2340
12 7/23/2002 11:43:00 AM 1230
11 7/24/2002 11:43:00 AM 3490
11 7/23/2002 11:43:00 AM 2150
10 7/24/2002 11:43:00 AM 2075
10 7/23/2002 11:43:00 AM 1600
9 7/23/2002 11:43:00 AM 2140
9 7/24/2002 11:43:00 AM 1310
8 7/24/2002 11:43:00 AM 2700
8 7/23/2002 11:43:00 AM 1560
7 7/24/2002 11:43:00 AM 2000
7 7/23/2002 11:43:00 AM 1840
6 7/24/2002 11:43:00 AM 4900
6 7/23/2002 11:43:00 AM 1520
5 7/24/2002 11:43:00 AM 3290
5 7/23/2002 11:43:00 AM 2000
4 7/24/2002 11:43:00 AM 3085
4 7/23/2002 11:43:00 AM 1600
3 7/24/2002 11:43:00 AM 2045
3 7/23/2002 11:43:00 AM 1200
2 7/23/2002 11:43:00 AM 3250
2 7/24/2002 11:43:00 AM 3000
1 7/23/2002 11:43:00 AM 3000
1 7/24/2002 11:43:00 AM 2000

ASP HTML Download            FAQ

ASP.NET Version

This works just like our Database Sort sample except it adds the ability to sort by multiple fields. I attached it to a different table (one that had multiple records with the same value in some fields) so that you could see it actually working.

The last field clicked is the highest priority sort. So if you want to see the entries sorted by SalesmanId (Ascending) and then by the Amount of the sale (Ascending) you would click on the + next to the Amount heading and then by the + next to the SalesmanId heading.

The script will go back as many sort criteria as you want but it removes duplicates so if you sort by SalesmanId Ascending and then by SalesmanId Descending, only the last desc is passed to the database.

The only real thing missing is some sort of pretty indicator telling you the current sort sequence, but, if you hadn't already noticed, UI design isn't really our thing... we'll leave it to you.


Samples

Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers