2023 Jul 21 7:48 PM
I have a query to show all items, POs against them, and their corresponding invoices. It's bringing up duplicate DocNum for each PO. Is there a way to limit it to just the invoice rather than all invoice documents?
SELECT T0."ItemCode",T0."Dscription", T1."DocNum" as "PO #", T2."CardName", T1."DocDueDate", T1."DocStatus", T0."Quantity" as "Original Quantity", T0."OpenQty", T3."DocNum" as "Invoice #" FROM "SGL_LIVE"."POR1" T0 INNER JOIN "SGL_LIVE"."OPOR" T1 ON T0."DocEntry" = T1."DocEntry" INNER JOIN "SGL_LIVE"."OCRD" T2 ON T0."BaseCard" = T2."CardCode" INNER JOIN OPCH T3 ON T2."CardCode" = T3."CardCode"
2023 Jul 21 9:37 PM
bwyrick
SELECT T0."ItemCode",T0."Dscription", T1."DocNum" as "PO #", T2."CardName", T1."DocDueDate", T1."DocStatus", T0."Quantity" as "Original Quantity", T0."OpenQty", T3."DocNum" as "Invoice #"
FROM "SGL_LIVE"."POR1" T0
INNER JOIN "SGL_LIVE"."OPOR" T1 ON T0."DocEntry" = T1."DocEntry"
INNER JOIN "SGL_LIVE"."OCRD" T2 ON T0."BaseCard" = T2."CardCode"
INNER JOIN OPCH T3 ON T2."CardCode" = T3."CardCode"
WHERE T3.DocType = 'IV'
2023 Jul 23 12:38 PM
I get a system message of "No data was found" with this criteria when I add the where clause.