Skip to Content
0
Former Member
Apr 17, 2009 at 12:22 PM

Query with DO - G.Return, INV - AR CreditMemo

44 Views

Hi Experts,

I have write a query which DO minus out Good Return as below :-

SELECT T1.DocDate AS 'Posting Date', T1.DocNum AS 'Document Number',T0.ItemCode AS 'Item No.', T0.Dscription AS 'Item/Service Description', (T0.Quantity- IsNull(T2.Quantity,0)) AS 'Quantity', T0.unitMsr AS 'UOM' , T0.WhsCode AS 'WhseCode'

FROM dbo.DLN1 T0 INNER JOIN dbo.ODLN T1 ON T1.DocEntry = T0.DocEntry

LEFT JOIN dbo.RDN1 T2 ON T2.BaseEntry = T0.DocEntry AND T2.ItemCode = T0.ItemCode

WHERE T1.DocDate>=[%0] AND T1.DocDate <=[%1]

ORDER BY T1.DocDate

If i did till DO then Good Return and same of the Invoice, other Invoices did till Invoice then AP CreditMemo.

How to write a query which DO MINUS G.Return, INV MINUS AR CreditMemo?

Your advise is highly appreciated.

Regards,

Danny.