on 12-07-2011 9:11 PM
Hi,
I was wondering if is possible to add an order count/total weight per day for the query below.
Thanks,
Steve
SELECT T0.DocDueDate, T0.DocNum, T0.CardName, T1.whscode, T0.DocDate, SUM(T1.weight1) 'Weight'
FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.DocDueDate>=[%0] and T0.DocDueDate<=[%1] and T1.whscode LIKE '%[%2]%' and T0.DocStatus = 'C'
GROUP BY T0.DocDueDate, T0.DocNum, T0.CardName, T1.whscode, T0.DocDate,
ORDER BY T0.DocDueDate, T0.DocNum
Hi Steve,
If you need that info. It can't be co-exist. Try:
SELECT T0.DocDueDate, T0.CardName, T1.whscode, SUM(T1.weight1) 'Weight',Count(T0.DocNum)/SUM(T1.weight1) 'Avg Weight / Order'
FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.DocDueDate>=[%0\] and T0.DocDueDate<=[%1\] and T1.whscode LIKE '%[%2\]%' and T0.DocStatus = 'C'
GROUP BY T0.DocDueDate, T0.CardName, T1.whscode,
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try:
SELECT T0.DocDueDate, T0.CardName, SUM(T1.weight1) 'Total Weight/Day',Count(T0.DocNum) 'Order/Day'
FROM ORDR T0 INNER JOIN RDR1 T1 ON T0.DocEntry = T1.DocEntry
WHERE T0.DocDueDate>=[%0\] and T0.DocDueDate<=[%1\] and T1.whscode LIKE '%[%2\]%' and T0.DocStatus = 'C'
GROUP BY T0.DocDueDate, T0.CardName
User | Count |
---|---|
110 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.