In one of our famous APEX projects we had the requirement to select a month from a select list. The select list itself should contain all months half a year before and half a year after current date. Below you can see the select-statement of our LOV. Maybe it will be helpful for somebody out there.
1 2 3 4 5 6 7 8 9 10 |
with dates as ( select add_months(add_months(trunc(sysdate, 'MM'), -6), offset) first_day_of_month from ( select level - 1 offset from dual connect by level <= 13 ) ) select to_char(first_day_of_month, 'Month YYYY') display_value, to_char (first_day_of_month, 'YYYYMM') return_value from dates |