So we have to create week by week file of our historic shipping details.
I am thinking of using a Foreach Loop Container to do this and increment the week counter and derive the @StartDate and @EndDate Parameters that way using something like this...
SELECT DATEADD(WK, -50, DATEADD(DAY, 1-DATEPART(WEEKDAY, GETDATE()), DATEDIFF(DD, 0, GETDATE()))) --first day previous week
Obviously Incrementing the -50 in a Foreach Loop somehow
And then after deriving my @StartDate and @EndDate Parameters, execute the SQL Server Stored Procedure accordingly
Does this sound reasonable? How do I handle and control that within the Foreach Loop?
Thanks for your review and am hopeful for a reply.