Skip to Content
Former Member
Jul 07, 2010 at 06:03 PM

Query Help


I was using the query below and needed to add a field from the table OCRG. I was able to pull it through but do not get any data to display. What did I do wrong. I wish I knew SQL better.

SELECT T0.ShipDate AS 'Ship Date', T4.GroupName AS 'Group Name', T1.DocNum, T1.cardName AS 'Customer', T0.ItemCode AS 'Item No.', T0.Dscription AS 'Description', T0.DelivrdQty AS 'Quantity', T0.unitMsr AS 'Unit', T0.linetotal AS '$' FROM [dbo].[RDR1] T0 FULL OUTER JOIN [dbo].[ORDR] T1 ON T1.DocEntry = T0.DocEntry FULL OUTER JOIN [dbo].[OCRD] T2 ON T2.CardCode = T1.CardCode AND T2.CardCode = T1.BPChCode FULL OUTER JOIN [dbo].[RDR1] T3 ON T3.BaseCard = T2.CardCode FULL OUTER JOIN [dbo].[OCRG] T4 ON T4.GroupCode = T2.GroupCode WHERE T0.ShipDate Between [%0] AND [%1] AND (T0.DelivrdQty >0) ORDER BY T0.ShipDate, T1.CardName, T1.DocNum