Buenos dias,
Tengo esta consulta:
SELECT T0.[CardCode], T0.[CardName], T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[DocTotal], T0.[PaidSum], T0.[DocTotal] - T0.[PaidSum] AS 'TotalPendiente', T0.[PeyMethod] FROM [dbo].[OINV] T0 WHERE T0.[CANCELED] = ('N' ) AND T0.[DocStatus] = ('O' ) AND T0.[DocDueDate] = CONVERT (DATE,GETDATE()) UNION SELECT T0.[CardCode], T0.[CardName], T0.[DocNum], T0.[DocDate], T0.[DocDueDate], T0.[DocTotal], T0.[PaidSum], T0.[DocTotal] - T0.[PaidSum] T0.[PeyMethod] FROM [dbo].[OPCH] T0 WHERE T0.[CANCELED] = ('N' ) AND T0.[DocStatus] = ('O' ) AND T0.[DocDueDate] =CONVERT(DATE,GETDATE())
Que me muestra los documentos que me vencen hoy. Pero me gustaria que me mostrara los vencimientos con 4 dias de antelación… Entiendo que es facil, pero no doy con ello. ¿Alguien me puede echar una mano?
GRACIAS!!!