Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Date sort???
Can't really tell from post without table def., but check that publishtime
is a date datatype. Also, check the century with the following:
select to_char(publishtime, 'MM/DD/YYYY') chk_time
from articles
order by publishtime;
Kenny Gump
Alex Peng wrote in message <7ktg8j$28ec$1_at_earth.superlink.net>...
>Hi,
>
>I use Oracle 8.0.4 in Windows NT.
>I have the following SQL :
>
>select publishtime from articles order by publishtime;
>
>Can anyone explain why year 98 comes after year 99?
>Thanks,
>
>Alex
>
>The result is : (some of records return null)
>
>28-MAY-99
>28-MAY-99
>28-MAY-99
>31-MAY-99
>31-MAY-99
>31-MAY-99
>01-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>04-JUN-99
>06-JUN-99
>06-JUN-99
>06-JUN-99
>06-JUN-99
>07-JUN-99
>07-JUN-99
>08-JUN-99
>08-JUN-99
>08-JUN-99
>08-JUN-99
>08-JUN-99
>09-JUN-99
>14-JUN-99
>14-JUN-99
>14-JUN-99
>14-JUN-99
>14-JUN-99
>14-JUN-99
>15-JUN-99
>15-JUN-99
>15-JUN-99
>15-JUN-99
>15-JUN-99
>15-JUN-99
>15-JUN-99
>15-JUN-99
>15-JUN-99
>15-JUN-99
>21-JUN-99
>21-JUN-99
>21-JUN-99
>21-JUN-99
>21-JUN-99
>21-JUN-99
>21-JUN-99
>21-JUN-99
>22-JUN-99
>22-JUN-99
>22-JUN-99
>22-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>23-JUN-99
>01-FEB-98
>01-FEB-98
>01-FEB-98
>01-FEB-98
>01-FEB-98
>01-FEB-98
>01-FEB-98
>01-FEB-98
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>107 rows selected.
>
>
Received on Thu Jun 24 1999 - 15:03:20 CDT