Week Number of Year, Month and Day

Bandi
Posted by Bandi under Sql Server category on | Points: 40 | Views : 510
SELECT GETDATE() Today, ((day(GETDATE())-1) / 7) + 1 WeekNumberOfMonth
,DATEPART(WEEK,GETDATE()) WeekNumberOfYear
,DATENAME(WEEKDAY, GETDATE()) WeekName
,DATEPART(WEEKDAY,GETDATE()) WeekNumber

OUTPUT:
Today WeekNumberOfMonth WeekNumberOfYear WeekName WeekNumber
2014-07-24 12:19:14.150 4 30 Thursday 5

Comments or Responses

Login to post response