I need to split multiple weeks between the given range of dates and then send each week to queue

My start date is 07.01.2021 and end date is 12.01.2021, i need to find out the number of days and divide them by 7(multiple weeks) and then send each week to queue and process them manually. We need to split multiple weeks within the given range of dates(start date and enddate) .

Datediff is how you find the number of days between two dates.

https://support.microsoft.com/en-us/office/datediff-function-e6dd7ee6-3d01-4531-905c-e24fc238f85f

I need to split multiple weeks in the given range of dates(dates would be changed dynamically it may be a month, 3 months, 6 months or more) where I’ve to divide the given range of dates into weeks and then process each week manually(7 days in the week) .

Datediff tells you how many days. Divide that by 7, loop and use Dateadd to get the date of the first day of each week.