Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Q: select with between date/time

Re: Q: select with between date/time

From: Spencer <spencerp_at_swbell.net>
Date: Sat, 25 Aug 2001 22:50:53 -0500
Message-ID: <nl_h7.96$3x3.95666@nnrp3.sbc.net>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US