1 Reply Latest reply: Mar 21, 2012 5:23 PM by Victor Angoa Camacho RSS

    Create calendar based on the past 5 years

    Jeroen Jordaan
      Hi all,

      I want to create a calendar always based on the past 5 years.
      So when we are 2 years further the calendar has to start on 1/1/2009 and ending on the current date or the end of the year of the current date. So in the example above 31/12/2014.

      I tried it with the following syntax.
      Can anyone help with that?

      thank you so much
      TempCalendar:
      LOAD
      Date(RecNo()+Date#(Today(),'DDMMYYYY')) AS CalendarDate
      AutoGenerate Today() - Date(Today()-5);
        • Create calendar based on the past 5 years

          Hello Jeroen


          I hope this review will serve



          VarMinDate LET num = (today ());

          VarMaxDate LET num = (today ()) +1825;



          Calendar:

          LOAD

          $ (varMinDate) + Rowno () - 1 AS Num,

          date ($ (varMinDate) + Rowno () - 1) AS TempDate

          AutoGenerate

          $ (varMaxDate) - $ (varMinDate) + 1;


          If you are ages 5 and up, this is correct. if history, reverses varMinDate and varMaxDate and -1825


          regards