|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, November 06, 2012 7:44 AM
Points: 13,
Visits: 126
|
|
Hi Everybody 
We ship books - no more than 10 books per box. And Other items (toys, etc.) – no more than 15 pounds per box. Books are shipped separately from Other items. But orders usually contain a mix of items (let's say: 28 Books and 34 pounds of Other items).
Is there a way to create a packing slip for every box? In the case described above:
- Two boxes with 10 books each - One box with 8 books - Two boxes with 15 pounds of Other items each - One box with 9 pounds of Other items
Thank you!
|
|
|
|
|
SSCarpal Tunnel
       
Group: General Forum Members
Last Login: Today @ 9:19 AM
Points: 4,234,
Visits: 9,469
|
|
justforgroups2004 (11/5/2012)
Hi Everybody  We ship books - no more than 10 books per box. And Other items (toys, etc.) – no more than 15 pounds per box. Books are shipped separately from Other items. But orders usually contain a mix of items (let's say: 28 Books and 34 pounds of Other items). Is there a way to create a packing slip for every box? In the case described above: - Two boxes with 10 books each - One box with 8 books - Two boxes with 15 pounds of Other items each - One box with 9 pounds of Other items Thank you!
Based on the information that you have provided, I'd say that the answer is yes.
But if you want a technical solution, you'll have to provide sample data, DDL, desired output - see the link in my signature for details.
____________________________________________________________________________________________
Help us to help you. For better, quicker and more focused answers to your questions, consider following the advice in this link:
http://www.sqlservercentral.com/articles/Best+Practices/61537/
If you are asking for help and your post does not contain a question, you should expect responses which do not contain any answers. Put a question mark in there somewhere - it's not rocket science.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Tuesday, November 06, 2012 7:44 AM
Points: 13,
Visits: 126
|
|
Thank you for reply, Phil!
Here's the data generator. Still working on the output.
---------------------
CREATE TABLE [dbo].[Orders]( [OrderNumber] [int] NOT NULL, [ItemNumber] [varchar](30) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [ItemDescription] [varchar](255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL, [Book] [int] NULL, [OtherItem] [int] NULL, [WeightEach] [decimal](20, 8) NULL, [NumberOfPieces] [int] NULL ) ON [PRIMARY]
---------------------
INSERT INTO orders (OrderNumber,ItemNumber,ItemDescription,Book,OtherItem,WeightEach,NumberOfPieces)
SELECT '1','ku85487','Dr. Seuss','1','0','0.00000000','30' UNION ALL SELECT '1','w5647f','Perplexus Maze Game','0','1','5.00000000','2' UNION ALL SELECT '1','lk875fc','Llama Llama','1','0','0.00000000','9' UNION ALL SELECT '2','547juy0','Where the Wild Things Are','1','0','0.00000000','6' UNION ALL SELECT '2','ikj75254','Pete the Cat','1','0','0.00000000','8' UNION ALL SELECT '2','hytr54','Happy Birthday to You','1','0','0.00000000','10' UNION ALL SELECT '2','58jkjhyt','Spot It','0','1','3.00000000','4'
---------------------
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 4:43 PM
Points: 192,
Visits: 640
|
|
Hi - If I understood correctly : It looks like your first step is a [boxes] entity/table. A stored procedure could go through the order, determine how many boxes are needed then create and assign a book or other item to the appropriate box ID .You can then insert the pair (book1, box1).. into a item-Box transactions table. You should have a field in the box table to identify what type of items it holds (books/..) as well.
|
|
|
|