Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Is this possible in oracle 9.2 or is my logic way out on third base

Is this possible in oracle 9.2 or is my logic way out on third base

From: MrHelpMe <clinttoris_at_hotmail.com>
Date: 31 May 2007 19:26:08 -0700
Message-ID: <1180643496.359333.24890@z28g2000prd.googlegroups.com>


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 - 21:26:08 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US