I want to create a list in the script which contains all the last 11 months, which will get updated dynamically
For example if i am running the app on 27th Sept 2017 , i should get the following list :
Please help me on this.
Solved! Go to Solution.
here is one of the methods to do it:
SET v_STARTDATE = '01/01/2016';
SET v_ENDDATE = '01/12/2017';
LOAD date(date#('$(v_STARTDATE)','DD/MM/YYYY')-1 + recno() ,'DD/MM/YYYY') as Date
AUTOGENERATE (date#('$(v_ENDDATE)','DD/MM/YYYY') - date#('$(v_STARTDATE)','DD/MM/YYYY')) + 1 ;
Month(Date)&Year(Date) as Month_year
where Date < AddMonths(today(),-1) and Date > AddMonths(today(),-11);
DROP TABLE TMP_DATE;
Hope it helps