Good morning, I have a problem and I do not know how to solve it, I need to make a report, which I requested certain measurements by MES. What I have is the Query of each measurement, but I do not know how to group all these Querys through an SP, rather than help, I need to know how to do it, with what method, etc.
Querys:
Commitments per Month:
Select COUNT(c.ID) as 'CantidadGenerada' ,MONTH(c.Com_FechaCreacion) as 'Mes' from Compromisos c
group by MONTH(c.Com_FechaCreacion)
Number of attendees:
select Count(Re.ID) as 'CantidadIntegrantes' from Rel_Reunion_Integrantes RE
inner join Reuniones R on
R.ID=RE.Reu_ID
group by MONTH(R.Reu_FechaCitaInicio)
Number of cases solved:
Select COUNT(c.ID) as 'CantidadResuelto' ,MONTH(c.Com_FechaTermino) as 'Mes' from Compromisos c
group by MONTH(c.Com_FechaTermino)
Total Hours per month:
select sum((datediff(minute, R.Reu_FechaCitaInicio, R.Reu_FechaCitaTermino))) AS 'DuracionReuniones',Month(Reu_FechaCitaInicio) as 'Mes'
from Rel_Reunion_Integrantes RE
inner join Reuniones R on
R.ID=RE.Reu_ID
group by MONTH(R.Reu_FechaCitaInicio)
Quantity Meetings:
select COUNT(R.ID) as 'CantidadReuniones',MONTH(R.Reu_FechaCitaInicio) as 'Mes' from Reuniones R
group by MONTH(R.Reu_FechaCitaInicio)
Result to obtain: