I get a date like @periodId int = 201801, where 2018 is the year and 01 is the month. This data is converted to datetime format as follows.
declare @periodIdDatetimeFormat datetime select @periodIdDatetimeFormat = convert(varchar(4),@periodId/100)+ '-'+convert(varchar(2),@periodId%100)+'-'+'01'
The result is a date like "2018-01-01". It is necessary to display all the weeks of the given month in the format 01.01.2018-07.01.2018, with the first day of the week should be Thursday and last Friday (01.01-Thu, 07.01-Fri). Is there any way to do this using tsql?