I have this
DATEDIFF
query but it is not returning the result I am expecting.
SELECT 5 * ((DATEDIFF('2018-03-10', '2018-02-26') +1) DIV 7) +
MID('0123444401233334012222340111123400012345001234550', 7 * WEEKDAY('2018-
02-26') + WEEKDAY('2018-03-10') + 1, 1)
The result of this query should be the number working days (excluding weekend days) from start to end.
I expected an output of 10 days but instead the query returns 9. When I count the days on the calendar, I count 10 days. Anyone knows what the problem is?