How to generate week ranges like this picture in sql

Hi! I need to generate the week ranges like this format :

Here from date and to date would be picked up from the table but just to make you understand i have hard coded it but this is the real date which is falling inside the table. 

Note : Week should be generated from Monday to Sunday within desired date range


May 28th, 2015 3:22am

I cannot see the picture, can you post here a desired result? Always state what version you are using,
Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 3:31am

I am using sql 2012 . Here are the desired results :

Week 1 :  1-July-2014    6-July-2014
Week 2 :  7-July-2014    13-July-2014
Week 3 :  14-July-2014     20-July-2014
Week n : 27-July-2015     31-July-2015

May 28th, 2015 3:38am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics