Advertisement
daxruiz

Untitled

Apr 20th, 2022
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.39 KB | None | 0 0
  1. SELECT * FROM dbo.Recibos r
  2. WHERE CONVERT(VARCHAR, r.FechaCreacion, 112) = 20220420
  3. AND r.Contrato_ContratoId IN (
  4. SELECT cc.Contrato_ContratoId FROM dbo.ContratoCuotas cc
  5. INNER JOIN Contratos co ON co.ContratoId = cc.Contrato_ContratoId
  6. WHERE CONVERT(VARCHAR,cc.FechaCuota,112) < CONVERT(VARCHAR,GETDATE(),112) AND
  7. CONVERT(VARCHAR,cc.FechaPagada,112) > CONVERT(VARCHAR,co.FechaUltimaCuota,112)
  8. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement