May 27, 2008 at 10:46 pm
Comments posted to this topic are about the item Difference between two dates in weeks
May 28, 2008 at 7:13 am
Couldn't you just use the following?
SELECT DATEDIFF(wk,@StartDate,@EndDate)
May 28, 2008 at 8:29 am
I don't think that datediff(wk) salutes @@DateFirst.
[font="Courier New"]DateFirst StartDate EndDate DateDiff WeekDiff
--------- ----------- ----------- ----------- -----------
7 Sun 25May08 Mon 26May08 0 0
7 Mon 19May08 Sun 01Jun08 2 2
7 Sat 24May08 Sun 25May08 1 1
DateFirst StartDate EndDate DateDiff WeekDiff
--------- ----------- ----------- ----------- -----------
1 Sun 25May08 Mon 26May08 0 1
1 Mon 19May08 Sun 01Jun08 2 1
1 Sat 24May08 Sun 25May08 1 0
[/font]
May 28, 2008 at 8:43 am
Says here that DATEDIFF doesn't consider DATEFIRST.
https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=239958
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply