Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello, i need to (monthly) iterate from InitMonth to ActualMonth but this code doesn't work
LET vActualMonth = Num(MonthStart(Today()));
LET vInitMonth = Num(MonthStart(AddMonths(vActualMonth, -2)));
FOR vLoopMonth = vInitMonth to vActualMonth step AddMonths(vLoopMonth, 1)
.
.
.
...
NEXT
Any help please?
If i skip the step expression i can iterate daily but i want to get a monthly iteration.
The step expression is only evaluated once and it is an increment, so that approach won't work. Here's another approach.
LET vActualMonth = Num(MonthStart(Today()));
LET vInitMonth = Num(MonthStart(AddMonths(vActualMonth, -2)));
FOR i = 0 to 2
LET vLoopMonth = AddMonths($(vInitMonth), $(i));
// Do something with vLoopMonth
NEXT i
-Rob