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

Home -> Community -> Usenet -> c.d.o.server -> Re: Query Date by Time

Re: Query Date by Time

From: Charles Hooper <hooperc2000_at_yahoo.com>
Date: 6 Nov 2006 11:01:28 -0800
Message-ID: <1162839688.051149.269720@i42g2000cwa.googlegroups.com>


Gomer wrote:
> Greetings,
>
> I'm pulling out my hair on this one.
>
> I want to create a query that pulls data by the previous date, between
> the hours 23:00 and 23:30.
>
> I've read through newsgroups for a couple of days, and I've gone
> through my Oracle manuals, to no avail.
>
> Can anyone offer a suggestions or two?
>
> Thanks,
> BKC
TRUNC(SYSDATE) is midnight, (TRUNC(SYSDATE) - 1/24) is 23:00 (11PM) on the previous date. (TRUNC(SYSDATE) - 1/48) is 23:30 (11:30PM) on the previous date.

The above implies:
WHERE
  MY_COLUMN BETWEEN (TRUNC(SYSDATE) - 1/24) AND (TRUNC(SYSDATE) - 1/48) Charles Hooper
PC Support Specialist
K&M Machine-Fabricating, Inc. Received on Mon Nov 06 2006 - 13:01:28 CST

Original text of this message

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