In the below image I am trying to start the week of "ManufactureDate" to every Monday but unable to get it the desired result.
Query used:
select distinct dateadd(week, DATEDIFF(week, 0, [ManufactureDate]),0 )sp, [ManufactureDate]
FROM ab
Current result Set:
SP Manufacturing Date
2019-10-14 00:00:00.000 2019-10-13 00:00:00.000
2019-10-14 00:00:00.000 2019-10-14 00:00:00.000
2019-10-14 00:00:00.000 2019-10-15 00:00:00.000
2019-10-14 00:00:00.000 2019-10-16 00:00:00.000
2019-10-14 00:00:00.000 2019-10-17 00:00:00.000
2019-10-14 00:00:00.000 2019-10-18 00:00:00.000
2019-10-21 00:00:00.000 2019-10-20 00:00:00.000
Desired result:
Sp Manufacturing Date
10/14/2019 10/14/2019
10/14/2019 10/15/2019
10/14/2019 10/16/2019
10/14/2019 10/17/2019
10/14/2019 10/18/2019
10/14/2019 10/20/2019
10/21/2019 10/21/2019
Image: