navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

 

Sorting Quandry

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Sorting Quandry
Page: [1]
 
hessfirm

 

Posts: 153
Joined: 9/15/2004
Status: offline

 
Sorting Quandry - 1/14/2008 17:07:51   
this one might be simple...but i can't seem to see it clearly


  • let's say i a table of 100 records
  • i will only display 50
  • to determine the 50, i order using a numerical calculation in my DRW SQL statement
  • i want, though, to display those 50 results alphabetically


so the initial numerical ordering in the sql statement is how they are displayed...but what i want displayed is a "re-ordered" set of results after they are ordered numerically. I can't create a view to do this...it needs to all be done using a single sql statment in the DRW referencing 1 table.

does that make sense and can it be done?

Thanks!


_____________________________

Steve Hess
rdouglass

 

Posts: 9280
From: Biddeford, ME USA
Status: offline

 
RE: Sorting Quandry - 1/16/2008 11:32:17   
quote:

it needs to all be done using a single sql statment in the DRW referencing 1 table.


Something like this works in SQL Server:

SELECT TOP (100) PERCENT TableName.TextFieldToSortOn, derivedtbl_1.Expr1 AS Expr2 FROM TableName INNER JOIN (SELECT TOP (50) [CalculatedFieldValue] AS Expr1, RecordID FROM TableName AS TableName_1) AS derivedtbl_1 ON TableName.RecordID = derivedtbl_1.RecordID ORDER BY TableName.TextFieldToSortOn

Hope it helps.

_____________________________

Don't take you're eye off your final destination.

ASP Checkbox Function Tutorial.

(in reply to hessfirm)
Page:   [1]

All Forums >> Web Development >> ASP and Database >> Sorting Quandry
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts