I would like to build a SQL statement to automatically retrieve information about all the weeks of a month. For example, for the month of February 2023:
- Retrieve the first week (Monday to Sunday): 30/01/2023 - 05/01/2023 ...
- Retrieve the last week : 27/02/2023 - 05/03/2023.
Thanks in advance!
Use a row-generator to generate a list of weeks for the month:
Which outputs:
fiddle