Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Query de ventas

Hola Foro

tengo una duda respecto a un query de ventas cuando lo ejecuto asi si funciona bien y me arroja los datos, es este

SELECT T0.DocDate AS Fecha, T0.DocNum AS Docto, T0.CardName AS Cliente, T0.NumAtCard AS Pedido,

T1.ItemCode AS Referencia, T1.Dscription AS Articulo, T1.Quantity AS Cantidad, T1.Price AS Precio, T1.Quantity * T1.Price AS Total

FROM OINV AS T0 INNER JOIN

INV1 AS T1 ON T0.DocEntry = T1.DocEntry

WHERE (T0.CardName = N'SEPRT DE C.V.') AND (T0.DocType = 'I')

Pero cuando le agrego otra tabla ya no me arroja informacion

SELECT T0.DocDate AS Fecha, T0.DocNum AS Docto, T0.CardName AS Cliente, T0.NumAtCard AS Pedido,

T1.ItemCode AS Referencia, T1.Dscription AS Articulo, T1.Quantity AS Cantidad, T1.Price AS Precio, T1.Quantity * T1.Price AS Total, T2.County

FROM OINV AS T0 INNER JOIN

INV1 AS T1 ON T0.DocEntry = T1.DocEntry INNER JOIN

CRD1 AS T2 ON T0.Address = T2.Address

WHERE (T0.CardName = N'SEPRT DE C.V.') AND (T0.DocType = 'I')

aqui lo unico que hago es agregar la columna T2.County de la tabla CRD1 lo hacemos asi porque el nombre con el que identificamos la tienda a la que se factura se lo ponemos ahi

Gracias por su ayuda

Saludos

Former Member
Not what you were looking for? View more on this topic or Ask a question