Finding serial numbers from goods receipt
If you print a goods receipt it will show the serial number of an item purchased but I cannot find a field in PDN1 or any other linked table to pull this out in a query along with purchase order numbers etc.
Former Member replied
Your join is bad here:
OSRI T2 INNER JOIN OPDN T3 ON T1.DocEntry = T3.DocEntry
You can't join T2 to T3 via T1.DocEntry
Try this:
SELECT T3.DocNum as GoodsReceiptPONum, T4.DocNum as APInvoiceNum, T4.NumAtCard,
T1.ItemCode, T1.Dscription, T1.Quantity, T0.SysSerial,
T0.SuppSerial, T1.TrgetEntry
FROM
[dbo].[OSRI] T0 INNER JOIN [dbo].[PDN1] T1 ON T0.BaseEntry = T1.DocEntry
INNER JOIN [dbo].[OPDN] T3 ON T3.docentry = T1.DocEntry
INNER JOIN [dbo].[OPCH] T4 ON T1.TrgetEntry = T4.DocEntry
WHERE T0.BaseType = 20 and T1.itemcode = '2SSY560'