• Referring to the article on the calendar table, you could add a [month] column that would makes this easy for you.

    You would create the field and update it by adapting the following:

    select [calendardate]

    , dateadd(d,-day([calendardate])+1,[calendardate])

    from calendar

    From here the calculation becomes a simple matter.

    select[month], count(*) numWorkDays

    fromCalendar

    where[calendardate]>= @fromDate and [calendardate]<=@untilDate and

    workday = 1

    group

    by [month]

    ----------------------------------------------------