addm report with sysdate - hours - need yesterday between 10am and 12pm

oracle 11 running addm report
the report that you helped with before works fine - just trying to adjust the time period for the report

running the report at 10AM system time
I want 10AM to 12PM yesterday

have
WHERE begin_interval_time >=  trunc(sysdate -20/24) and end_interval_time < trunc(sysdate -8/24);

report returns dates
29-JUL-15 01.00.26 AM
29-JUL-15 11.00.11 PM

can you tell me what I have wrong?

Thanks
LVL 1
bkreynolds48Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

johnsoneSenior Oracle DBACommented:
Did you check what those date functions return?  They should be giving you:

07/29/2015 00:00:00 and 07/30/2015 00:00:00

It isn't hard to check them before you put them in the query, just do:

select trunc(sysdate -20/24), trunc(sysdate -8/24)
from dual;

I don't think that is what you are looking for.

10:00 AM yesterday would be TRUNC(SYSDATE) - (14/24)
12:00 PM yesterday would be TRUNC(SYSDATE) - (12/24)
0
bkreynolds48Author Commented:
so that would be

WHERE begin_interval_time >=  trunc(sysdate) - (14/24) and end_interval_time < trunc(sysdate) - (12/24);
0
sdstuberCommented:
begin_interval_time >= trunc(sysdate-1) + 10/24        -- 00:00:00 yesterday  plus 10 hours, 10am
and end_interval_time < trunc(sysdate-1) + 12/24      -- 00:00:00 yesterday plus 12 hours, 12pm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bkreynolds48Author Commented:
thanks - that worked
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.