Results 1 to 3 of 3

Thread: Doing Time in SQL

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 1999
    Location
    Greenville, MS, Washington
    Posts
    38

    Post

    ...when I use the SQL statement--

    "ORDER BY latest.Date DESC"

    I certainly get my dates in decending order. But I've noticed that several records recorded on the same day aren't sorted with the most recent record being the first record. How can I use time to further sort decending dates by decending time?

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    Do you have a field called 'TIME'? If time is included in the Date field, it should do it automatically, unless you have your field as a text field and not a date field.....

    If you have an autonumber field, you could also sort by that field, descending, because the most recent records will have a greater autonumber....

    HTH

    Tom

  3. #3
    Lively Member
    Join Date
    Dec 1999
    Location
    Karlsruhe, Germany
    Posts
    122

    Post

    If multiple records have the same value and your sorting by that value, it's not defined in what order the records with the same value come back.

    The best is, as Tom mentioned, to use an auto value.

    Roger

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width