I have table with columns Start date and end date and i need to enter values for 2 years.I created a for loop and I am trying to load values for every month.
For Example, My first input start Date is 10/12/2016
end date 11/11/2016
. It
should be incremented with one month and inserted into table for 2 years.
For Loop Container
InitExpression: @windowStart="10/12/2016"
Evalexpression: @WindowStart<@windowMaxdate
AssignExpression: @windowStart= Dateadd("mm",1,@windowStart)
Execute sql task
SQL command:
Insert into dbo.datetemp
(WindowStart,WindowEnd ) values (?,?)
My problem is i am not getting values what i am expected and its just
returning same windowstart
and windowend
for every record. And loop is not coming to stop.