Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

sql to get data from the previous day

2632048Oct 28 2014 — edited Oct 30 2014

Hello,

I am asked to collect data from the previous day and generate a report everyday to determine the success rate(there needs to be data everyday which determines the success rate). I have a column session_time (with DATE datatype) which I look for to get the job done. I have been using:

select * from abc

where session_time >= TRUNC(SYSDATE - 2)

This gives me data, however I get data from 10/26/14 and 10/28/14 as well when I only need data from 10/27/14 (current date being 10/28/14). I tried a few variations and did not get the expected result. Could someone please help me figure this out? Time is also displayed in my output, perhaps I should not include the time?

I use: TOAD for Oracle 11.5.1.2,

Oracle Database 11g Enterprose Edition 11.2.0.1.0

Thank you in advance.

This post has been answered by Frank Kulash on Oct 28 2014
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 27 2014
Added on Oct 28 2014
12 comments
19,433 views