Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Y2K to_date SQL question

Y2K to_date SQL question

From: Jim Pistrang <jim_at_jpcr.com>
Date: Thu, 15 Oct 1998 11:45:00 -0400
Message-ID: <jim-1510981145000001@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 Received on Thu Oct 15 1998 - 10:45:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US