Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Dating!
Allan Saadbye wrote:
>
> Dear usergroup,
>
> I've a little performence problem, concerning date formats and performance.
>
> My simple question is how and where to run a little routine like :
>
> sql>Select
> to_date(rpad(to_char(sysdate-1,'ddmmyyyy'),12,'0800'),ddmmyyyyhh24mi') from
> dual;
>
> The point is to get data from an undefined starting point and getting data
> collected by the last 24 hoursgg uding either unix or sql.
>
> Please reply !
select *
from my_table
where my_date_column < sysdate - 1
will return data in the last 24 hours from the current moment...
select *
from my_table
where my_date_column < trunc(sysdate)
will return data for all of "yesterday"
HTH --
"Some days you're the pigeon, and some days you're the statue." Received on Mon Jul 19 1999 - 08:46:49 CDT
![]() |
![]() |