cancel
Showing results for 
Search instead for 
Did you mean: 

Query Help

Former Member
0 Kudos
74

I have the following Query and I am tryibg to add from OITW 'OnHand', 'IsCommitted', 'OnOrder'.

SELECT T1.DocNum AS 'Order #', T1.DocDueDate AS 'Cancel', T1.TaxDate AS 'Start', T1.CardName AS 'Name', T0.ItemCode AS 'Item #', T0.Dscription AS 'Desc.', T0.OpenCreQty AS 'Qty' FROM [dbo].[RDR1] T0 INNER JOIN [dbo].[ORDR] T1 ON T1.DocEntry = T0.DocEntry WHERE (T0.OpenCreQty > 0 ) ORDER BY T1.DocDueDate

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Here you are:

SELECT T1.DocNum AS 'Order #', T1.DocDueDate AS 'Cancel', T1.TaxDate AS 'Start', T1.CardName AS 'Name', T0.ItemCode AS 'Item #', T0.Dscription AS 'Desc.', T0.OpenCreQty AS 'Qty', T2.OnHand, T2.IsCommited, T2.OnOrder

FROM dbo.RDR1 T0 INNER JOIN dbo.ORDR T1 ON T1.DocEntry = T0.DocEntry

INNER JOIN dbo.OITW T2 on T2.ItemCode = T0.ItemCode AND T2.WhsCode = T0.WhsCode

WHERE (T0.OpenCreQty > 0 ) ORDER BY T1.DocDueDate

Please close your another thread which is duplicated.

Thanks,

Gordon

Answers (1)

Answers (1)

former_member325312
Active Contributor
0 Kudos

hello

JIm

try this query

SELECT ORDR.DocNum, ORDR.DocDueDate, ORDR.CardName,

ORDR.TaxDate, RDR1.ItemCode, RDR1.Dscription,

RDR1.OpenCreQty, OITW.OnHand,

OITW.IsCommited, OITW.OnOrder

FROM ORDR INNER JOIN RDR1 ON ORDR.DocEntry = RDR1.DocEntry INNER JOIN

OITW ON RDR1.ItemCode = OITW.ItemCode

WHERE RDR1.OpenCreQty >0 and RDR1.WhsCode = OITW.WhsCode

GROUP BY ORDR.DocNum, ORDR.DocDueDate, ORDR.CardName, ORDR.TaxDate,

RDR1.ItemCode, RDR1.Dscription, RDR1.OpenCreQty, RDR1.WhsCode,

OITW.OnHand, OITW.IsCommited, OITW.OnOrder, OITW.WhsCode

ORDER BY ORDR.DocDueDate asc

i think it will solve ur problem and if s pls close the thread

Regards

Jenny