on 10-01-2015 11:52 PM
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
select OINV.DocNum as 'Factura N0',
INV1.ItemCode as 'Codigo',
INV1.Dscription as 'Descripcion',
INV1.Quantity as 'Cantidad',
ISNULL(ODLN.DocNum,0) as 'Embarque N0',
CASE
OINV.InvntSttus
When 'C'
then 'Cerrado'
when 'O'
then 'Abierto'
else 'NULL'
end AS 'Tipo'
from OINV INNER JOIN INV1 ON OINV.DocEntry = INV1.DocEntry
INNER JOIN DLN1 ON DLN1.BaseEntry = OINV.DocEntry
INNER JOIN ODLN ON DLN1.DocEntry = ODLN.DocEntry
where OINV.DocDate BETWEEN @i and @f
GROUP BY OINV.DocNum,OINV.DocEntry,INV1.LineNum,INV1.ItemCode,INV1.Dscription,INV1.Quantity,ODLN.DocNum,OINV.InvntSttus,OINV.InvntSttus
Antonio,
Tu query es de facturas de reserva, correcto?
Si hasta el momento es el único problemas, soluciónalo cambiando los INNER JOIN de ODLN y DLN1 por LEFT JOIN.
Saludos,
JC.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
10 | |
6 | |
5 | |
5 | |
4 | |
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.