Advertisement
Advertisement
| 07.16.2008 at 01:59PM PDT, ID: 23571280 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: |
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 |