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: Michel Cadot <micadot_at_francemel.com>
Date: Wed, 18 Aug 1999 09:29:22 +0200
Message-ID: <7pdndj$kne$1@oceanite.cybercable.fr>


select * from your_table
where trunc(your_date,'MM')=trunc(add_months(sysdate,-1),'MM');

john bruin a écrit dans le message <37BA05BA.4CE9_at_tssc.co.nz>...
>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
Received on Wed Aug 18 1999 - 02:29:22 CDT

Original text of this message

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