Viewing post 1 (of 1 total)
The following simple code solves the problem more elegantly in my opinion:
SELECT (DATEDIFF(wk, @begin_date, @end_date) * 2)
+(CASE WHEN DATENAME(dw, @begin_date) = 'Sunday' THEN 1 ELSE 0 END)
August 23, 2018 at 8:52 am
Viewing post 1 (of 1 total)
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy