|
| |
|
|
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.
|
|
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
|
|
|