How to get week number of the month from the date in SQL server?
How to get week number of the month from the date in SQL server?
This is such a simple way to get the week number of the month.
declare @date date = ‘3 Nov 2019’
select convert(int, datepart(wk, @date)) – convert(int, datepart(wk, DATEFROMPARTS(YEAR(@date),MONTH(@date),1))) + 1
— return 2
*calendar starts from SUNDAY as the first day.
View On WordPress











