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: return last month

Re: return last month

From: Terry Dykstra <tddykstra_at_forestoil.ca>
Date: Thu, 08 Nov 2007 23:02:33 GMT
Message-ID: <dAMYi.11197$8S5.8529@edtnps82>


"jobs" <jobs_at_webdos.com> wrote in message news:1194561672.085769.316410_at_s15g2000prm.googlegroups.com...
> sorry to have to ask this.
>
> How do I return last month in mm format?
>
> For example it's November 8th Today. I'd like to get 10 back. If it
> were January 8th, i'd like to get 12 back.
>
> Thanks.
>

Take a look at the add_months() function, e.g.: select to_char(add_months(sysdate,-1),'mm') from dual

-- 
Terry Dykstra 
Received on Thu Nov 08 2007 - 17:02:33 CST

Original text of this message

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