Sorting by dateTime

J. Landman Gay jacque at hyperactivesw.com
Tue Feb 14 16:12:50 EST 2006


Gregory Lypny wrote:
> Hello again,
> 
> There's obviously something I don't understand about sorting.  I  typed 
> this into the message box.
> 
> set useSystemDate to true
> set the itemDelimiter to tab
> put \
> 1 & tab & "01/10/1999 5:54 AM" & return & \
> 2 & tab & "30/09/1999 9:16 PM" & return & \
> 3 & tab & "15/08/1999 8:23 PM" into d
> sort lines of d dateTime by second item in each
> put d
> 
> And I get this back.
> 
> 2    30/09/1999 9:16 PM
> 3    15/08/1999 8:23 PM
> 1    01/10/1999 5:54 AM
> 
> Revolution isn't treating the dates as strings; otherwise the order  
> would be 1, 3, and 2, which it is when I omit dateTime from the  
> direction of the sort.  I checked to make sure that my system date  
> format is dd/mm/yyyy and that the time uses a twelve-hour clock.
> 
> Any thoughts?

Try this syntax:

   sort lines of d dateTime by item 2 of each

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list