Oracle DATE sorting help

Discussion in 'MySQL' started by saintdw, Oct 14, 2005.

  1. #1
    I have a table with following type of data inserted

    DATE ('02-5-2005') i.e. the output of that would be "2-May-05"


    The problem is, when I try to do a ORDER BY date, date being a column with dates, it onle sorts them by first digit, i.e. "2" and doesnt consider month or year.

    What am I doing wrong?
     
    saintdw, Oct 14, 2005 IP
  2. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #2
    Have you tried using a timestamp? You can always change the way the date is displayed once you extract the date. I dont know how this is done for Oracle however as I'm more used to MySQL.
     
    Weirfire, Oct 18, 2005 IP
  3. saintdw

    saintdw Peon

    Messages:
    453
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I figured it out.

    When i created table I used varchar2 instead of DATE. :eek:
     
    saintdw, Oct 20, 2005 IP
  4. Weirfire

    Weirfire Language Translation Company

    Messages:
    6,979
    Likes Received:
    365
    Best Answers:
    0
    Trophy Points:
    280
    #4
    :) Thought it might have been something like that.
     
    Weirfire, Oct 21, 2005 IP