Group Query and then split results

G

Gary Dolliver

Hi all,
I am trying to run a query to create shipping labels. What I am currently
doing is grouping on the order_ID and creating one shipping label per order.
However, I would like to have another shipping label print out upon every
break at 25 of item_qty, so if I had 30 items, I would have two labels...
Here is my current SQL for the query:
SELECT orders.Order_ID, orders.ShipTo_FName, orders.ShipTo_LName,
orders.ShipTo_Organization, orders.ShipTo_Addr1, orders.ShipTo_Addr2,
orders.ShipTo_City, orders.ShipTo_State, orders.ShipTo_ZIP5,
orders.ShipTo_Country, orders.ShipTo_Phone, orders.ShipTo_Ext,
orders.ShipTo_Email, First(production_shipments.Item_ID) AS FirstOfItem_ID,
Sum(production_shipments.Ship_Qty) AS SumOfShip_Qty
FROM orders INNER JOIN production_shipments ON orders.Order_ID =
production_shipments.Order_ID
WHERE (((production_shipments.Ship_Order_ID)<>0) AND
((production_shipments.Ship_Date) Is Null))
GROUP BY orders.Order_ID, orders.ShipTo_FName, orders.ShipTo_LName,
orders.ShipTo_Organization, orders.ShipTo_Addr1, orders.ShipTo_Addr2,
orders.ShipTo_City, orders.ShipTo_State, orders.ShipTo_ZIP5,
orders.ShipTo_Country, orders.ShipTo_Phone, orders.ShipTo_Ext,
orders.ShipTo_Email;
Any help would be appreciated, thanks!
-gary
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Split recordset of Query 4

Top