Print Page | Close Window

Help wit h "Order by"

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3193
Printed Date: 29 March 2026 at 12:03pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Help wit h "Order by"
Posted By: betheball
Subject: Help wit h "Order by"
Date Posted: 01 June 2003 at 5:30pm
I have an ASP page written with FrontPage.  The page consists of three columns.  Column one lists each possible value of one of my table fields (Cause).  Column two is a count showing how many times each cause appears in the main table of my db.  And column three shows the percentage of times the value occurs in the db.  Here is my problem, I want my results to appear in numeric order, highest to lowest.  When I add Order By Count DESC, it orders them, but only on the first digit.  So the number 3 appears before the number 25.  Any ideas on how to get it to do a true sort???



Replies:
Posted By: michael
Date Posted: 01 June 2003 at 6:10pm
That can happed if you selected the wrong datatype for your column. Make it a number field if it is access. I guess you used text right?

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Bullschmidt
Date Posted: 01 June 2003 at 11:08pm

How about this with the idea of converting to a long integer:

Order By CLng(Count) DESC



-------------
J. Paul Schmidt, Freelance ASP Web Developer
www.Bullschmidt.com - www.Bullschmidt.com
Classic ASP Design Tips, ASP Web Database Sample (Freely Downloadable)



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net