Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old May 11th, 2003, 02:05 AM
Nevyn1943 Nevyn1943 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 3 Nevyn1943 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Retrieve Records In Reverse Order

I would like to get the records out starting with the last in first and so on. Is there a way to do that with using Order By.<br><br>My select statement is as follows:<br><br><div class="msgQuoteWrap"><div class="msgCode">SQL = "select * from DiscussionTopicComment Where ComboHex = '" & GetRecordNumber & "'"</div></div><br><br>I just want to reverse the order I do not want to Order them on any on field.<br><br>Thanks<br>Nevyn

Reply With Quote
  #2  
Old May 11th, 2003, 10:45 AM
EXTiNCE EXTiNCE is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 2 EXTiNCE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I would add DESC on the end of the SQL DESC = Desending order.<br>It will look like this after:<br>SQL = "select * from DiscussionTopicComment Where ComboHex = '" & GetRecordNumber & "' DESC"

Reply With Quote
  #3  
Old May 11th, 2003, 12:26 PM
Nevyn1943 Nevyn1943 is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 3 Nevyn1943 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I tried your suggestion but it does not work. Thanks for trying<br><br>Nevyn

Reply With Quote
  #4  
Old July 11th, 2003, 10:23 AM
Draiken Draiken is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 1 Draiken User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
DECS works when used after an ORDER BY.

Reply With Quote
  #5  
Old July 11th, 2003, 11:15 AM
jpenn
Guest
ASP Free Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Ya - as Draiken said, you need to use ORDER BY first. This is needed to let the db know which column to use to do the sorting:
Code:
SELECT column,column,column FROM some_table WHERE somthing = something ORDER BY column DESC

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseMicrosoft SQL Server > Retrieve Records In Reverse Order


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway