Re: Date field Problem
From: Shawn Belaire - Sun Ottawa SSE <shawn_at_canada.sun.com>
Date: 1996/02/26
Message-ID: <3131E6EF.37EB_at_canada.sun.com>#1/1
Date: 1996/02/26
Message-ID: <3131E6EF.37EB_at_canada.sun.com>#1/1
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
-- Yes you must use trunc(date_field) with your query because date fields are stored to a greater length than dd-mm-yy regards Shawn Belaire Sun Microsystems of Canada Ph: (613) 787-4278 SunService SSE 350 Albert Street, Suite 1700 Ottawa, Ontario, K1R 1A4, Canada shawn.belaire_at_Canada.sun.comReceived on Mon Feb 26 1996 - 00:00:00 CET