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: Frank van Bortel <frank.van.bortel_at_gmail.com>
Date: Thu, 26 Apr 2007 20:01:51 +0200
Message-ID: <f0qp8v$ko6$1@news2.zwoll1.ov.home.nl>


Joe schreef:
> 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
>

Look up the MM format mask of the to_char function in combination with date types.

SQL*Plus reference guide, I'd say, on
http://tahiti.oracle.com

While you're at it, also check the YYYY format mask - it can be helpful with selecting your 5 year period

-- 
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
Received on Thu Apr 26 2007 - 13:01:51 CDT

Original text of this message

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