Y2K to_date SQL question
Date: Thu, 15 Oct 1998 11:40:15 -0400
Message-ID: <jim-1510981140150001_at_ip71.dialup.crocker.net>
Y2K to_date SQL question
Hi all,
I've got some data that's fed in from an old system. There's a cancel
date field named canyymmdd thats a 6 character field in yymmdd format. I
convert it to a date field for most functions, but there's one place where
I need to return the earliest date in a table using the yymmdd format.
Before Y2K I could do this:
select min(canyymmdd) from mytable;
I was hoping I could get around Y2K by doing this, but it doesn't work:
select min(to_date(canyymmdd,'YYMMDD')) from mytable
I realize I could modify the database so the field is yyyymmdd, but I'd
rather not! Is there a SQL command that will return the earliest yymmdd
for me, taking into account the fact that 000101 is greater than 991230?
tia
Jim