on 12-20-2011 8:07 PM
Estimado Señores del foro,
Necesito alguna query que me permita saber cuales son los socios de negocios que no me han comprado en los últimos 7 días.
Espero me puedan ayudar.
Gracias, Saludos desde Chile
Hans
Intenta esto
select cardcode from ocrd where cardcode not in
(select cardcode from oinv where docdate between getdate()-7 and getdate () )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Buenos dias
Prueba este query
SELECT A0.CardCode AS 'Codigo', A0.DocDate AS 'ultima Venta', A0.Diferencia AS 'Dias Ultima Vta'
FROM ( SELECT TOP 1 T0.DocEntry AS 'DocEntry', T0.CardCode AS 'CardCode', T0.DocDate AS 'DocDate', DATEDIFF(dd,T0.DocDate,GETDATE()) AS 'Diferencia'
FROM OINV T0
WHERE T0.DocDate <= (GETDATE ()-7)
ORDER BY T0.DocDate DESC
) A0
ORDER BY 3
Saludos desde Chile
Atte
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.