Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I want to use the last day of the month in STEP for "FOR NEXT" in script. How can I do that.
please see the code I am using and suggest.
LET vSTARTASKAR=43370; //MAKEDATE(YEAR(43370),MONTH(43370),DAY(43370));
LET vENDASKAR=TODAY()-1;
FOR vOUTDATE = $(vSTARTASKAR) TO $(vENDASKAR) step MonthEnd(vSTARTASKAR)
OUTCALENDER:
LOAD
'$(vOUTDATE)' AS vOUTDATE,
63+$(vOUTDATE) as sum,
CD
Resident finalloop;
// EXIT FOR
NEXT
Try using å DO WHILE loop in favour of the FOR loop.
Like this.
LET vSTARTASKAR=43370;
Let vENDASKAR=TODAY()-1;
Do while vSTARTASKAR < vENDASKAR
OUTCALENDER:
LOAD
'$(vSTARTASKAR)' AS vOUTDATE,
63+$(vSTARTASKAR) as sum,
CD
Resident finalloop;
Let vSTARTASKAR=floor(monthend(vSTARTASKAR, 1));
Loop
Try using å DO WHILE loop in favour of the FOR loop.
Like this.
LET vSTARTASKAR=43370;
Let vENDASKAR=TODAY()-1;
Do while vSTARTASKAR < vENDASKAR
OUTCALENDER:
LOAD
'$(vSTARTASKAR)' AS vOUTDATE,
63+$(vSTARTASKAR) as sum,
CD
Resident finalloop;
Let vSTARTASKAR=floor(monthend(vSTARTASKAR, 1));
Loop
thanks alot, This really helps.
I never thought of Do while.
This is working 100%