New topic: 

Order by timestamp

<http://forums.realsoftware.com/viewtopic.php?t=32258>

       Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic         Author  
Message       rlinsurf           Post subject: Order by timestampPosted: Fri 
Jan 29, 2010 11:29 pm                        
Joined: Tue Mar 21, 2006 12:49 am
Posts: 191              I want to sort my rs by a timestamp field, 
jottsText.created, in ascending order:
Code:dim sql as string ="SELECT jottsText.ROWID, jottsText.ID, jottsText.text, 
jottsText.page, jottsText.dateHolder, jottsText.created, jottsText.modified 
FROM jottsText ORDER BY jottsText.created ASC"



The form of the data in this field is "2008-06-20 22:48:22".

But when I perform it, it's sorting all out of order. So I'm obviously missing 
something...   
                            Top               Kyan           Post subject: Re: 
Order by timestampPosted: Sat Jan 30, 2010 1:28 am                        
Joined: Tue Aug 14, 2007 8:44 am
Posts: 389              If I'm not mistaken, the best way to do this is by 
using totalseconds.   
                            Top               timhare           Post subject: 
Re: Order by timestampPosted: Sat Jan 30, 2010 2:20 am                        
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 7185
Location: Portland, OR  USA              No, it should work.  SQL Date and 
TimeStamp formats are designed to work with an alphabetic sort.  Are you sure 
the data is stored in the proper format?   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 3 posts ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to