Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Is this code even possible with SQL in oracle 9.2
Using oracle 9.2 and trying to construct a sql query that has the
following. I will show the logic/code that I am trying to do and then
explain.
[code]
WHERE
trunc(field a) BETWEEN
(trunc(sysdate,'DAY')-6) and (trunc(sysdate,'DAY')-2)
AND
trunc(field a) BETWEEN (trunc(sysdate + 90)) and
(trunc(sysdate + 90,'DAY'))+ 5;
[/code]
I am trying to say within last week Monday to Friday date range, show me how many requests were greater then 90 days but only limit it to the end of the week of the beginning of that 90 day day.
So last week May 21-25/07
90 days from may 21 = Lets just say August 21/07
August 21/07 falls on a Tuesday so show everything from Tuesday to
Friday
There may be 300 entries that are greater then August 21/07 but I only
want to capture anything till the end of the week of August 21/07.
This will obviously change depending on what day the 90 days falls
on. Am I making sense. So basically I am comparing everything that
is happening in one week to a furture week so to speak.
Received on Thu May 31 2007 - 17:21:55 CDT
![]() |
![]() |