Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Creating a variable for month end dates for the past year

I need to create a variable to use in a for loop to execute a stored procedure. The variable needs to hold the last date of every month going back one year from Today(). Is this possible?

1 Reply
dplr-rn
Partner - Master III
Partner - Master III

yes.

try something like below

let vMonthdates ='';
for i=1 to 12
	vMonthdates=vMonthdates &','&MonthEnd(addmonths(today(),-1*i))
next;