Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Q: select with between date/time
FYI, you don't need the TO_CHAR and TO_DATE
functions, use the TRUNC function instead. e.g.
today4am DATE := TRUNC(SYSDATE)+4/24;
yesterday7pm DATE := TRUNC(SYSDATE)-5/24;
"Anurag Varma" <avdbi_at_hotmail.com> wrote in message
news:7171ca2d.0108251832.4187b992_at_posting.google.com...
> In PL/SQL
> DECLARE
> today4am DATE := TO_DATE(
> to_char(sysdate,'mmddyyyy') || '04:00:00', 'mmddyyyy
hh24:mi:ss');
> yesterday7pm DATE := today4am - 9/24;
>
> ....
> SELECT .....
> WHERE daDate BETWEEN today4am AND yesterday7pm;
>
>
>
> Anurag
>
> Ralf Bender <ralf.bender_at_nexgo.de>
> > hello
> >
> > i want to write a select statement which tells me all rows between
> > yesterday 07:00PM and today 04:00AM, BUT i don't know how. i want save
> >
> > Can someone tell how to write such select?
> >
> > thx
> > ralf
>
Received on Sat Aug 25 2001 - 22:50:53 CDT
![]() |
![]() |