Hi
I have a report that shows information. I am testing against data on 2 orders. On one order number all the rows and Pack information comes through. When I use another order number I am getting rows missing on row 3 (see below). I have tried the Joins and changing them in all possible ways but cannot get them to show. I know this probably is a big ask but can anyone (with more experience than me)see anything blatantly wrong with the joins at all. (code below). By the way I have adapted an old report which shows the information in row 3, I had to do some changes to make it run with only showing shipref where = 2000. The information in Row 3 is true for the If statement.
I will keep trying but if anyone as any ideas it would be appreciated. Thanks
SELECT "OrderHeader"."OrderNumber", "OrderHeader"."DeliveryAddress", "OrderLine"."LineNumber", "OrderLine"."Quantity", "OrderLine"."Notes", "OrderHeader"."OrderID", "OrderHeader"."CustomerRef", "OrderLine"."LineType", "Product"."ProductType", "Product"."Length", "Product"."Width", "Product"."Thickness", "Product"."Description", "OrderLine"."ManualDescription", "OrderLine"."ManualCode", "Customer"."Name", "OrderHeader"."OrderType", "Product"."ProductCode", "Customer"."CashAccount", "OrderLine"."QuantityTally", "OrderHeader"."DeliveryDate", "OrderHeader"."NoOfPacks", "DinoOrderLineOption"."PackRef", "DinoOrderLineOption"."PackNoOfPieces", "DinoOrderLineOption"."Packlength", "DinoOrderLineOption"."OrderLineItemType", "DinoOrderLineOption"."packvolume", "DinoOrderLineOption"."PackQuantityTally", "OrderLine"."TotalLength", "OrderLine"."InputPerID", "CustomerAddress"."Telephone2", "CustomerProductReference"."CustomerProductDescription", "Product"."ProductGroupID", "ProductPack"."ShippingRef", "ProductGroup"."ParentID"
FROM ((((((("OrderHeader" "OrderHeader" LEFT OUTER JOIN "OrderLine" "OrderLine" ON "OrderHeader"."OrderID"="OrderLine"."OrderID") LEFT OUTER JOIN "Customer" "Customer" ON "OrderHeader"."CustomerID"="Customer"."CustomerID") LEFT OUTER JOIN "HTI Live"."dbo"."CustomerAddress" "CustomerAddress" ON "OrderHeader"."DeliveryAddressID"="CustomerAddress"."CustomerAddressID") LEFT OUTER JOIN "HTI Live"."dbo"."CustomerProductReference" "CustomerProductReference" ON ("OrderHeader"."CustomerID"="CustomerProductReference"."CustomerID") AND ("OrderLine"."ProductID"="CustomerProductReference"."ProductID")) LEFT OUTER JOIN "Product" "Product" ON "OrderLine"."ProductID"="Product"."ProductID") LEFT OUTER JOIN "DinoOrderLineOption" "DinoOrderLineOption" ON "OrderLine"."OrderLineID"="DinoOrderLineOption"."OrderLineID") INNER JOIN ("HTI Live"."dbo"."ProductPack" "ProductPack" RIGHT OUTER JOIN "HTI Live"."dbo"."OrderLineItem" "OrderLineItem" ON "ProductPack"."PackID"="OrderLineItem"."PackID") ON "OrderLine"."OrderLineID"="OrderLineItem"."OrderLineID") INNER JOIN "HTI Live"."dbo"."ProductGroup" "ProductGroup" ON "Product"."ProductGroupID"="ProductGroup"."ProductGroupID"
WHERE "OrderHeader"."OrderNumber"=3251546
ORDER BY "OrderHeader"."OrderID", "OrderLine"."LineNumber", "DinoOrderLineOption"."PackRef"
I have a report that shows information. I am testing against data on 2 orders. On one order number all the rows and Pack information comes through. When I use another order number I am getting rows missing on row 3 (see below). I have tried the Joins and changing them in all possible ways but cannot get them to show. I know this probably is a big ask but can anyone (with more experience than me)see anything blatantly wrong with the joins at all. (code below). By the way I have adapted an old report which shows the information in row 3, I had to do some changes to make it run with only showing shipref where = 2000. The information in Row 3 is true for the If statement.
SELECT "OrderHeader"."OrderNumber", "OrderHeader"."DeliveryAddress", "OrderLine"."LineNumber", "OrderLine"."Quantity", "OrderLine"."Notes", "OrderHeader"."OrderID", "OrderHeader"."CustomerRef", "OrderLine"."LineType", "Product"."ProductType", "Product"."Length", "Product"."Width", "Product"."Thickness", "Product"."Description", "OrderLine"."ManualDescription", "OrderLine"."ManualCode", "Customer"."Name", "OrderHeader"."OrderType", "Product"."ProductCode", "Customer"."CashAccount", "OrderLine"."QuantityTally", "OrderHeader"."DeliveryDate", "OrderHeader"."NoOfPacks", "DinoOrderLineOption"."PackRef", "DinoOrderLineOption"."PackNoOfPieces", "DinoOrderLineOption"."Packlength", "DinoOrderLineOption"."OrderLineItemType", "DinoOrderLineOption"."packvolume", "DinoOrderLineOption"."PackQuantityTally", "OrderLine"."TotalLength", "OrderLine"."InputPerID", "CustomerAddress"."Telephone2", "CustomerProductReference"."CustomerProductDescription", "Product"."ProductGroupID", "ProductPack"."ShippingRef", "ProductGroup"."ParentID"
FROM ((((((("OrderHeader" "OrderHeader" LEFT OUTER JOIN "OrderLine" "OrderLine" ON "OrderHeader"."OrderID"="OrderLine"."OrderID") LEFT OUTER JOIN "Customer" "Customer" ON "OrderHeader"."CustomerID"="Customer"."CustomerID") LEFT OUTER JOIN "HTI Live"."dbo"."CustomerAddress" "CustomerAddress" ON "OrderHeader"."DeliveryAddressID"="CustomerAddress"."CustomerAddressID") LEFT OUTER JOIN "HTI Live"."dbo"."CustomerProductReference" "CustomerProductReference" ON ("OrderHeader"."CustomerID"="CustomerProductReference"."CustomerID") AND ("OrderLine"."ProductID"="CustomerProductReference"."ProductID")) LEFT OUTER JOIN "Product" "Product" ON "OrderLine"."ProductID"="Product"."ProductID") LEFT OUTER JOIN "DinoOrderLineOption" "DinoOrderLineOption" ON "OrderLine"."OrderLineID"="DinoOrderLineOption"."OrderLineID") INNER JOIN ("HTI Live"."dbo"."ProductPack" "ProductPack" RIGHT OUTER JOIN "HTI Live"."dbo"."OrderLineItem" "OrderLineItem" ON "ProductPack"."PackID"="OrderLineItem"."PackID") ON "OrderLine"."OrderLineID"="OrderLineItem"."OrderLineID") INNER JOIN "HTI Live"."dbo"."ProductGroup" "ProductGroup" ON "Product"."ProductGroupID"="ProductGroup"."ProductGroupID"
WHERE "OrderHeader"."OrderNumber"=3251546
ORDER BY "OrderHeader"."OrderID", "OrderLine"."LineNumber", "DinoOrderLineOption"."PackRef"