Re: Date... Fixed Day, minus one month

From: Carlos <miotromailcarlos_at_netscape.net>
Date: Fri, 23 Jul 2010 04:56:37 -0700 (PDT)
Message-ID: <b6762371-ac1c-4d03-8079-476543974f63_at_u26g2000yqu.googlegroups.com>



On Jul 23, 12:49 pm, Oliver <olit..._at_gmail.com> wrote:
> Dear all
>
> It might be a trivial issue for you.. but it keeps me busy and I'd be
> glad for help.
>
> Lets say, we now have "23.07.2010 13:45:21" as dd.mm.yyyy hh:mm:ss.
> I like to get the following date 20.06.2010. This is "today minus one
> month" and "always day 20".
>
> What I have currently is:
> TO_CHAR(ADD_MONTHS(SYSDATE, -1), 'DD-MM-YYYY HH:MM:SS')
>
> I've been traing with a lot of things but couldn't get it working...
>
> How can I have a fixed day in DD?
>
> Oliver

CARLOS_at_XE.localhost> select ADD_MONTHS(trunc(sysdate, 'MONTH'), -1 ) + 19 from dual;

ADD_MONTHS(TRUNC(SY



2010/06/20 00:00:00

HTH. Cheers.

Carlos. Received on Fri Jul 23 2010 - 06:56:37 CDT

Original text of this message