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 -> Re: Previous Month function

Re: Previous Month function

From: Breno de Avellar Gomes <brenogomes_at_ieee.org>
Date: Wed, 18 Aug 1999 03:26:03 +0100
Message-ID: <37BA19BB.5852720F@ieee.org>


Try this

select add_months(your_date, -1) "Previous month" from your_table;

john bruin wrote:

> Does anyone know if there is a function to select records for the
> previous month. In the past we have run a query on the 1st day of the
> month and selected for the previous 31 days ("sydate -31") which is OK
> but requires sorting/deletion of unwanted records for the months that
> have 30 days or less.
>
> Any help appreciated,
> John

--
Breno de Avellar Gomes
DBMS Developer

Arquivo-Sistemas de Bases de Dados
P. O. Box 5006
4017-001 Porto
Portugal

brenogomes_at_ieee.org
Cellular: +351 931 7383469
ICQ # 35567342 Received on Tue Aug 17 1999 - 21:26:03 CDT

Original text of this message

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