Good evening!
Well, I need to know the following result. I want to bring the workdays grouped by month and year from April to June of this year of 2017. Example:
Ano Mês Dias Uteis
2017 Abril 19
2017 Maio 18
2017 Junho 17
NOTE: There is already a function in our bank called day_uteis that performs the calculation of working days and holidays. I tried to do with the query below, however, without success.
select (dbo.dias_uteis('01-04-2017','30-06-2017')) diasuteis,
DATEPART(month, dbo.dias_uteis('01-04-2017','30-06-2017') ) Mês,
DATEPART(YEAR, dbo.dias_uteis('01-04-2017','30-06-2017')) Ano
group by DATEPART(YEAR, dbo.dias_uteis('01-04-2017','30-06-2017')),
DATEPART(MONTH, dbo.dias_uteis('01-04-2017','30-06-2017'))