Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jjordaan
Partner - Specialist
Partner - Specialist

Create calendar based on the past 5 years

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);
1 Solution

Accepted Solutions
Not applicable

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

View solution in original post

1 Reply
Not applicable

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