Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Number of Weeks

$
0
0

Hi Guys,

Just created an script and get the week number of  posteddatetime.

upon comparing to my excel data the derived result is not the same.

what is the difference? please advise. thanks.

declare @postedDatetime datetime
Set @postedDatetime='2013/03/27'
Select DATEPART (dw,@postedDatetime) as TWeek
result = 4 
In Excel formula
=ROUNDUP((DAY(O2)+WEEKDAY(DATE(YEAR(O2),MONTH(O2),0)))/7,0)
result= 5

 


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>