How to show week number in SQL Server?
How to show week number in SQL Server?
I’m doing report query now and it needs to show weekly data, so I need the query to show the week number of the date. I search at google, then I got it a simple query from here. I thanked for this query because it helps much. This is the answer : DECLARE @dt datetime, @WeekOfMonth tinyint SET @dt = '2007-07-08' set @WeekOfMonth = datediff(week, dateadd(month, datediff(month, 0, @dt), 0), @dt) +1…
View On WordPress














