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
#2003063