Hi,
Introduction:
The PO is used for products purchase but also separately for transport services (there are transport items for send and delivery transport services).
So in reality the transport PO is linked to SO and also situations are that product PO is linked to transport PO's.
Everything is fine when the PO linked to SO but I'm having a problem with showing data when PO is linked to PO..
I've made a query that runs fine for SO vs PO but II'm stuck with how to show results PO vs PO:
SELECT T0.[CreateDate] AS 'data utw.ZZ', T0.[CardCode], T1.[ItemCode], T0.[DocNum] AS 'Nr.ZZ', T1.[Price], T2.[DocNum] as 'Nr.ZS', T2.[U_U_p4] as 'MSC. ZALAD.', T2.[U_U_p5] AS 'MSC.ROZL.', T0.[U_WYSYLKA_DATA], T0.[U_WYSYLKA_GODZINA], T0.[U_AWIZACJA_DATA], T0.[U_AWIZACJA_GODZINA] FROM OPOR T0 INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry LEFT JOIN ORDR T2 ON T2.U_z1 = T0.Docnum WHERE T1.[ItemCode] Like '04.TRAN.%' AND T0.[CreateDate] >=[%0] AND T0.[CreateDate] <=[%1] AND T0.[CardCode]=[%2] ORDER BY T0.[CreateDate], T0.[DocNum]
The transport items in PO are: 04.TRAN.WYS% for sending products with SO or 04.TRAN.DOS% is for receiving products with PO.
Any help would be appreciated.
Thank you,
Tomasz