?
Solved

limiting records to yesterday 8pm data

Posted on 2011-04-28
4
Medium Priority
?
433 Views
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..

Thanks
0
Comment
Question by:gs79
  • 2
4 Comments
 
LVL 74

Accepted Solution

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

Assisted Solution

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

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

Expert Comment

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

Author Comment

by:gs79
ID: 35492300
Spot on!
0

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