Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Process historic data and create a file by week

$
0
0

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.


Viewing all articles
Browse latest Browse all 24688

Trending Articles