declare @startdate date = '2017-04-30'
select cast(datename(week,@startdate) as int)- cast( datename(week,dateadd(dd,1-day(@startdate),@startdate)) as int)+1
select cast(datename(week,@startdate) as int)- cast( datename(week,dateadd(dd,1-day(@startdate),@startdate)) as int)+1
No comments:
Post a Comment