The following SQL will calculate the number of workdays in a given month:
WITH t as ( select 1 x union all select x + 1 from t where x < day(dateadd(day, -1, dateadd(month, 1, datefromparts([year], [month], 1)))) ) SELECT COUNT(x) NumWeekDays from t whereDATEPART(dw, datefromparts([year], [month], x)) not in (1,7)
And for Connectwise, the following would calculate the number of work days in a given month: