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

Home -> Community -> Usenet -> c.d.o.server -> Re: Extracting certain months across multiple years

Re: Extracting certain months across multiple years

From: DA Morgan <damorgan_at_psoug.org>
Date: Thu, 26 Apr 2007 10:59:43 -0700
Message-ID: <1177610381.986886@bubbleator.drizzle.com>


Joe wrote:
> I am trying to extract or show a set of months over multible years,
> i.e. show JAN-MAR orders from order table. I don't know how to
> eliminate oracle from recognizing the years. Does this make sense? I
> can do it for single years with the statement:
> SELECT *
> FROM ORD
> WHERE ORDERDATE Between to_date('01-APR-1986')
> AND to_date('30-DEC-1986')
> How can I get the same result, say, over a five year period. Thanks in
> advance, Joe

It is really unclear what version of Oracle you have, the data type of your date ORDERDATE, etc.

But why not use the format tools such as 'MON' and 'YYYY' available with TO_DATE?

You can find them listed here:
http://www.psoug.org/reference/date_func.html

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Thu Apr 26 2007 - 12:59:43 CDT

Original text of this message

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