Re: Bringing Back Data for Previous 11 Months + This Month
Date: 29 Jun 2001 06:49:32 -0700
Message-ID: <ab87195e.0106290549.78d8d1de_at_posting.google.com>
You can try...(today being 29-JUN-2001)
select ADD_MONTHS(TRUNC(sysdate), -11) - TO_NUMBER(SUBSTR(sysdate, 1, 2) -1) from dual;
SQL> / ADD_MONTH
01-JUL-00 HTH, Mark
clay.mitchell_at_bankofamerica.com (Clay Mitchell) wrote in message news:<b0e58ae3.0106280950.34dd9ab_at_posting.google.com>...
> Ok, here's the deal. I need to bring back information in a table for
> this month (june 2001), plus the previous year (back to july, 2000).
> if i use add months, and do > add_months(sysdate, -11) it pulls back
> everything from this date (28th) of july 2000, which doesn't work
> because i need everything back from july.
>
> if i do > add_months(sysdate, -12) it pulls back the last few days
> from june 2000, which skews my results.
>
> how can i round it off to only pull back from the beginning of july?
>
> any help would be appreciated.
Received on Fri Jun 29 2001 - 15:49:32 CEST