Total Items items ordered but not shipped yet.
so from the order side of the DB you have 2 tables a header then a detail table
the header contains fields such as Customer, Order Date ect ect.
The Detail table contians further detail with order lines
Eg
[item number][ Description ] [QTY ordered], [Qty Shipped ], [Price] ect...
The 2 tables get linked by its unique system generated sequence key.
I created a crystal report and copied the SQL querry.
Code: Select all
SELECT
OEINVH."CUSTOMER", OEINVH."ORDDATE",
OEINVD."ITEM", OEINVD."QTYORDERED", OEINVD."QTYSHIPPED"
FROM
{ oj "SQLDB1"."dbo"."OEINVH" OEINVH INNER JOIN "SQLDB1"."dbo"."OEINVD" OEINVD ON
OEINVH."INVUNIQ" = OEINVD."INVUNIQ"}
WHERE
OEINVH."ORDDATE" >= 20080301 AND
OEINVH."ORDDATE" <= 20080331
ORDER BY
OEINVD."ITEM" ASC,
OEINVH."CUSTOMER" ASC
so I need to group by item first then group by Customer.
then have the subtotal of OEINVD."ITEM" basically the 'grand total' per item number.
After that i need to copy it into my existing stored proc and set
@field21 = the subtotal.
Questions how do i use group am i going into the correct direction ?
Tnx