Week calculation from a specific period

后端 未结 5 1793
轻奢々
轻奢々 2021-01-29 06:52

suppose the fiscal year is starting from July/1st to June/30th.

I have to calculate the week no. accordingly in SQL Server 2005.

Please Suggest!

Many Tha

5条回答
  •  天涯浪人
    2021-01-29 07:13

    try this
    
        select DATEPART(week,getdate())-DATEPART(week,'07-01-2012')
    
    To get the week number starting from July 1st 2012
    

提交回复
热议问题