Charity - Loans - Debt Consolidation - Mortgages - Xbox Mod Chip

PDA

View Full Version : Oracle DATE sorting help


saintdw
Oct 14th 2005, 5:41 pm
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?

Weirfire
Oct 18th 2005, 2:15 am
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.

saintdw
Oct 20th 2005, 4:30 pm
I figured it out.

When i created table I used varchar2 instead of DATE. :o

Weirfire
Oct 21st 2005, 1:37 am
:) Thought it might have been something like that.