limiting records to yesterday 8pm data

Posted on 2011-04-28
Medium Priority
Last Modified: 2013-12-18
I need to limit query to return records between yesterday 8 pm and day before yesterday 8pm

Ie select * from xyz where mydate between trunc(sysdate)_2  + 20hrs and sysdate _ 1 + 20 hrs
Please let me know how to do this..

Question by:gs79
  • 2
LVL 74

Accepted Solution

sdstuber earned 1400 total points
ID: 35484576
select * from xyz
where mydate between trunc(sysdate) - 2 + 20/24 and trunc(sysdate) - 1 + 20/24
LVL 78

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 600 total points
ID: 35484580

select * from xyz where mydate between trunc(sysdate-1) + 20/24 and trunc(sysdate) + 20/24
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 35484590
I was off by a day and sdstuber beat me to it...  his is correct.

Author Comment

ID: 35492300
Spot on!

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses
Course of the Month15 days, 10 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question