Re: Sysdate, help needed urgent:)

From: Ted Goulden <gouldent_at_cadvision.com>
Date: 1996/08/04
Message-ID: <4u3870$he2_at_elmo.cadvision.com>#1/1


        No doubt you are experiencing problems with the way ORACLE stores dates as date+time. A query on a column called audit_date such as "where audit_date = sysdate" will fail even if you inserted a row a few minutes ago. But a query like "where audit_date > to_date("5-aug-96", "dd-mon-yy") will work just fine. This is because ORACLE has stored the time (in seconds) and is doing a comparison that includes the time. The best solution I have found is to use the TRUNC function which trims off the time portion and leaves you with the date as in "where audit_date > trunc(sysdate)" or "where trunc(audit_date) = trunc (sysdate)"

Kenny Liew <kenliew_at_pl.jaring.my> wrote:

>Anyone out there knows how can I pull rows out from a table using an SQL
>statement, where the date in the rows equals the current date?
Received on Sun Aug 04 1996 - 00:00:00 CEST

Original text of this message