Home » RDBMS Server » Server Administration » Sort query according to a date value (also take time in account)
Sort query according to a date value (also take time in account) [message #373204] Wed, 04 April 2001 03:00 Go to next message
Sanet Marais
Messages: 1
Registered: April 2001
Junior Member
Hi,

I am currently struggling to sort a query according to a DATE value type. The date values are entered into the database in the following format : 'DD/MM/YYYY HH:MI:SS' (with the to_date method).

My first attempt was just to sort by a date value (eg date_time_ordered). But it seems to me that it only sort according to the date and does not take the time into account.

I have also tried the TRUNC method - this does not take the seconds into account when sorting. (Closest option is to sort to the minute)

I will be very grateful if anybody can give me some advice. It is crucial for my application to sort to the second.

Thanks

Sanet Marais
Re: Sort query according to a date value (also take time in account) [message #373206 is a reply to message #373204] Wed, 04 April 2001 03:58 Go to previous message
John R`
Messages: 1
Registered: April 2001
Junior Member
Well, I just tried it on our database (8.1.5) and it definitely orders by dates down to the second here.

A few suggestions: Are you sure the dates have times, and are they the times you think they should be?
(Trivial question) Are you sure you're using 'MI' and not 'MM' for the minutes in the date mask when populating the data?
Previous Topic: Blob
Next Topic: Help !! Resolving Primary key..?
Goto Forum:
  


Current Time: Mon Dec 23 05:23:08 CST 2024