I believe I have set the expressions right, but it keeps going into infinite loop. Here are the details:
Variables:
@CD Datetime = @[User::ED]
@ED datetime = 3/31/2014
@M12 Datetime = DATEADD("d", 1, DATEADD("m", -12, @[User::ED] ))
For-Loop:
InitExpression: @CD = @ED
EvalExpression: @CD > @M12
AssignExpression: @CD = DATEADD("m", -1, @CD)
Within the For Loop is an Execute SQL task that inserts the @CD value for that iteration into a table. The assignment expression is somehow not working, and hence the EvalExpression condition is never met. What am I missing?
I am running SQL Server 2012. Thanks.