Skip to Content

Outstanding PO Query

hi all expert,

This query as my outstanding Purchase Order, i get the error in "Received Quantity".

PO no.421 Purchase Item A QTY 800

PO no.422 Purchase Item A QTY 800, GRPO QTY 800

My query show in PO no.421 Purchase Qty 800, Open Qty 800 and Received Qty 800* this Qty 800 is my other PO receiving.

os-po-error.png

SELECT T0.[CardCode] as [BP Code], T0.[CardName] as [BP Name], T0.[DocNum] as [PO No.], T1.[ItemCode] as [Item No.], T1.[Dscription] as [Description], T1.[Quantity] as [Quantity], T1.[OpenQty] as [Open Quantity], SUM(isnull(T3.[Quantity],0)) as 'Received Qty' FROM dbo.OPOR T0 INNER JOIN dbo.POR1 T1 ON T0.DocEntry = T1.DocEntry LEFT JOIN dbo.PDN1 T3 ON T3.BaseEntry = T0.DocEntry AND T3.BaseLine = T1.Linenum LEFT JOIN dbo.OPDN T2 ON T2.DocEntry = T3.DocEntry WHERE T0.[DocDate] >=[%0] AND T0.[DocDate] <=[%1] AND T0.CardName LIKE '%[%2\]%' AND T1.[OpenQty] >=1 GROUP BY T0.[CardCode], T0.[CardName], T0.[DocNum], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[OpenQty]

hooi77

os-po-error.png (3.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 04, 2017 at 07:31 AM

    Hi,

    The query looks correct and your screenshot only show one line with QTY 800.

    Please double check that there really is not a GRPO drawn from PO no.421, or that it really is PO no.422 in the query result.

    Regards,

    Johan

    Add comment
    10|10000 characters needed characters exceeded