SELECT MAX(t3.POORDN) AS ORDNUM, MAX(t3.POORTY) AS ORDTYP, MAX(t3.POOPRI) AS ORDPRI, DECIMAL(COUNT(t2.ipordn),7,0) AS LINES, SUM(t2.IPORDQ) AS EACHQTY, /* In this section I belive a sub-query may be needed The result valuess needed are two values: Total full cases, total "remainder" or "each" items Each SKU on the order has a different items-per-case value in the master inventory table */ The code outside this block executes as expected. MAX(t3.POGWGT) AS GROSWT, MAX(t3.POGVOL) AS GROVOL, MAX(t3.POGVOL)/61440 AS ESTPAL, from hbcprodfl.witmb as t1 JOIN hbcprodfl.wopib AS t2 on T2.IPSKU = T1.ITSKU JOIN HBCPRODFL.WOPHB AS t3 ON t2.IPORDN = t3.POORDN WHERE t1.ITCSPK > 0 GROUP BY t2.IPORDN ORDER BY t2.ipordn
Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.