Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

current and past months

756712May 12 2010 — edited May 12 2010
Hi I have one query

I want to create a flag current and past using maximum date available… current will be the latest 12 months and past will be months older than latest 12 months
how to get this?

Date

1 --- 2007-04-01 00:00:00.000 --- Past
2 --- 2007-05-01 00:00:00.000 --- Past
3 --- 2007-06-01 00:00:00.000 --- Past
4 --- 2007-07-01 00:00:00.000 --- Past
5 --- 2007-08-01 00:00:00.000 --- Past
6 --- 2007-09-01 00:00:00.000 --- Past
7 --- 2007-10-01 00:00:00.000 --- Past
8 --- 2007-11-01 00:00:00.000 --- Past
9 --- 2007-12-01 00:00:00.000 --- Past
10 --- 2008-01-01 00:00:00.000 --- Past
11 --- 2008-02-01 00:00:00.000 --- Past
12 --- 2008-03-01 00:00:00.000 --- Past
13 --- 2008-04-01 00:00:00.000 --- Current
14 --- 2008-05-01 00:00:00.000 --- Current
15 --- 2008-06-01 00:00:00.000 --- Current
16 --- 2008-07-01 00:00:00.000 --- Current
17 --- 2008-08-01 00:00:00.000 --- Current
18 --- 2008-09-01 00:00:00.000 --- Current
19 --- 2008-10-01 00:00:00.000 --- Current
20 --- 2008-11-01 00:00:00.000 --- Current
21 --- 2008-12-01 00:00:00.000 --- Current
22 --- 2009-01-01 00:00:00.000 --- Current
23 --- 2009-02-01 00:00:00.000 --- Current
24 --- 2009-03-01 00:00:00.000 --- Current
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 9 2010
Added on May 12 2010
3 comments
1,018 views