good day what I want is to ask a question that you tell me last week has example 15 applications starting from Monday to Friday and next or down example 10 requests of the week ancestor so on but all in one consultation. I hope you can help me, I also hope to be specific in what I want. Thank you! this my code, dateadd is for you to take today's date and go back to last week
select count (t1.ID_SolicitudContrato) as conteo,
t1.fecha_Actualizacion,
t1.alcanceContrato,
t2.ID_SolicitudContrato,
t2.fecha_Actualizacion,
t2.alcanceContrato
from CON_SolicitudContrato as t1
inner join CON_SolicitudContrato as t2 on t1.fecha_Actualizacion =t2.fecha_Actualizacion
where t1.fecha_Actualizacion<DATEADD(wk,DATEDIFF(wk,7,GETDATE()),5)
and t1.fecha_Actualizacion >DATEADD(wk,DATEDIFF(wk,7,GETDATE()),0)
and t2.fecha_Actualizacion<DATEADD(wk,DATEDIFF(wk,14,GETDATE()),5)
and t2.fecha_Actualizacion >DATEADD(wk,DATEDIFF(wk,14,GETDATE()),0)
group by t1.ID_SolicitudContrato ,t1.fecha_Actualizacion,t1.alcanceContrato,t2.ID_SolicitudContrato ,t2.fecha_Actualizacion,t2.alcanceContrato
order by t1.ID_SolicitudContrato desc