I want to calculate the week number of the month,I want to calculate the week number whether its odd or even week how can I get this in TSQL ?
Thanks all!
SELECT (DATEPART(d, '02/07/2011')/7)%2 AS WeekNo, --Replace your date column in place of '02/07/2011'
CASE (DATEPART(d, '02/07/2011')/7)%2
WHEN 1 THEN 'Odd'
ELSE 'Even'
END AS WeekType