Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/10/2015, 16:55
antonio_dsanchez
 
Fecha de Ingreso: abril-2015
Mensajes: 130
Antigüedad: 9 años
Puntos: 0
consultas Facturas Abiertas por Falta de Envio de Material PT

Buenas tardes tengo una nueva consulta donde quiero mostrar mis facturas y ponga el estatus de estas si no cuentan con su respectiva remisión o embarque.



solo que mi campo que no todas las facturas están embarcadas y no cuentan con el dato DocNum,0) as 'Embarque N0' que es el numero de documento del embarque. por lo tal no me muestra todos los estatus de mis facturas.





este es mi código espero me puedan ayudar
Código SQL:
Ver original
  1. SELECT OINV.DocNum AS 'Factura N0',
  2. INV1.ItemCode AS 'Codigo',
  3. INV1.Dscription AS 'Descripcion',
  4. INV1.Quantity AS 'Cantidad',
  5. ISNULL(ODLN.DocNum,0) AS 'Embarque N0',
  6. CASE
  7. OINV.InvntSttus
  8. WHEN 'C'
  9. THEN 'Cerrado'
  10. WHEN 'O'
  11. THEN 'Abierto'
  12. ELSE 'NULL'
  13. END AS 'Tipo'
  14. FROM OINV INNER JOIN INV1 ON OINV.DocEntry = INV1.DocEntry
  15. INNER JOIN DLN1 ON DLN1.BaseEntry = OINV.DocEntry
  16. INNER JOIN ODLN ON DLN1.DocEntry = ODLN.DocEntry
  17. WHERE OINV.DocDate BETWEEN @i AND @f  
  18. GROUP BY OINV.DocNum,OINV.DocEntry,INV1.LineNum,INV1.ItemCode,INV1.Dscription,INV1.Quantity,ODLN.DocNum,OINV.InvntSttus,OINV.InvntSttus

Última edición por gnzsoloyo; 01/10/2015 a las 17:04