Re: Date field Problem

From: Charles Wolfe <cwolfe_at_ix.netcom.com>
Date: 1996/02/24
Message-ID: <4go48h$8s2_at_cloner3.netcom.com>#1/1


ymeng_at_Bayou.UH.EDU (Jerry Xia) wrote:
>I am using Oracle7.1 database and I have one date datatype column
>in a table. When I use "where date_column = TO_DATE('01-JAN-01')"
>in my query, it just works fine. But if I use
>"where date_column = TO_DATE('01 01 0001', 'mm dd yyyy')", it
>returns no rows. TO_DATE('01/01/01', 'mm/dd/yy') format doesn't
>work either.
>
>Does anyone know what is the problem? Is something wrong with the data
>stored in the table?
>
>Thank in advance.
>
>Jerry

Jerry,

Try doing something like the following:

SELECT column1, column2,...
FROM mytable where to_char(datefield, 'mm dd yyyy') = '01 01 1901';

or

SELECT column1,...
FROM mytable WHERE to_char(datafield, 'mm/dd/yyyy') = '01/01/1901';

hope this helps

regards,
Chuck

-- 
********************************************************************
Chuck Wolfe                         Phone:  (703)325-3718
Senior Consultant                   E-mail: cwolfe_at_ix.netcom.com
TELOS Consulting Services
460 Herndon Parkway
Herndon, VA 22070

I don't want the world, I just want your half...

********************************************************************
Received on Sat Feb 24 1996 - 00:00:00 CET

Original text of this message