Re: Dates Help!!

From: David Di Biaggio <dibiaggio_at_iquest.net>
Date: 1996/07/03
Message-ID: <31DB0889.18A1_at_iquest.net>#1/1


Chuck Hamilton wrote:
>
> clarket_at_voicenet.com (Penn Thomas) wrote:
>
> >I need help with dates and SQL. When I try to write a 'select'
> >statement which calls for the SysDate from 'DUAL' oracle tells me that DUAL
> >does not exist, I had believed that 'DUAL' is preset table which can not be
> >deleted in oracle.
> >
> >Also the SQL statement which I am trying to write calls, for the user to enter
> >a date within a program and then for oracle to search for all data between the
> >user's date, and theh 'SysDate', any help on how to write this is greatly
> >appreciated.
> >
> >thanks
> >clarke
> >
> >
>
> I don't think you need to use DUAL in order to get SYSDATE. Just use
> it with the table you're selecting.
> --
> Chuck Hamilton
> chuckh_at_dvol.com
>
> Never share a foxhole with anyone braver than yourself!

Try:

select col1, col2,..., coln
from table_name
where table_date_col between to_date('&date','dd-mon-yy') and sysdate;

The &date will prompt the user for a date that they enter in dd-mon-yy format and it will substitute this value in your select...hope this is what you were looking for. Received on Wed Jul 03 1996 - 00:00:00 CEST

Original text of this message