VbzCart/queries/qtyOrderItems Active
Jump to navigation
Jump to search
Details
- Returns: Same as qryOrderLines_Active, but by Item instead of OrdLine (and leaving out extra info about items which might return multiple records due to slight differences)
- Requires: qryOrderLines_Active
- Used by:
- Notes: In theory, the same item should never appear on more than one line in an order -- but current data has two older records in which this actually did take place. This query provides order-line data consolidated by item, in case it happens again.
- History:
- 2008-11-16 created for new restocking process
SQL
<mysql>CREATE OR REPLACE VIEW qryOrderItems_Active AS SELECT
ID_Order, ID_Item, SUM(QtyOrd) AS QtyOrd, COUNT(ID) AS CountLines
FROM qryOrderLines_Active GROUP BY ID_Order, ID_Item;</mysql>