Sorting objects in a dictionary into corresponding Pairs...
-
So here is my dilemma, rather then describe it I will show you it. Let say we take back a certain amount of records records from the DB Called Inventory Count and they have a corresponding number attached to them indicating if they are an opening Count (1) or a closing count (2) Date-Product-Quantity-Opening/Closing 1. 1/1/2010, Ice Cream Cones, 10, 1 2. 1/1/2010, Bananas, 8, 1 3. 1/1/2010, Chocolate Bars, 9, 1 4. 2/1/2010, Ice Cream Cones, 5, 2 5. 2/1/2010, Bananas, 4, 2 6. 2/1/2010, Chocolate Bars, 3, 2 7. 4/1/2010, Ice Cream Cones, 12, 1 8. 4/1/2010, Bananas, 8, 1 9. 4/1/2010, Chocolate Bars, 9, 1 10. 5/1/2010, Ice Cream Cones, 1, 2 11. 5/1/2010, Bananas, 2, 2 12. 5/1/2010, Chocolate Bars, 3, 2 I need to build a dictionary that will take the first group (Openings = 1) and do the subtraction of quantity for closing(Closing 2), This will make up Session 1, Session 2 will be the next corresponding groups of Opening = 1 - Closing = 2 Thanks for the help in advance, hopefully this is understandable
-
So here is my dilemma, rather then describe it I will show you it. Let say we take back a certain amount of records records from the DB Called Inventory Count and they have a corresponding number attached to them indicating if they are an opening Count (1) or a closing count (2) Date-Product-Quantity-Opening/Closing 1. 1/1/2010, Ice Cream Cones, 10, 1 2. 1/1/2010, Bananas, 8, 1 3. 1/1/2010, Chocolate Bars, 9, 1 4. 2/1/2010, Ice Cream Cones, 5, 2 5. 2/1/2010, Bananas, 4, 2 6. 2/1/2010, Chocolate Bars, 3, 2 7. 4/1/2010, Ice Cream Cones, 12, 1 8. 4/1/2010, Bananas, 8, 1 9. 4/1/2010, Chocolate Bars, 9, 1 10. 5/1/2010, Ice Cream Cones, 1, 2 11. 5/1/2010, Bananas, 2, 2 12. 5/1/2010, Chocolate Bars, 3, 2 I need to build a dictionary that will take the first group (Openings = 1) and do the subtraction of quantity for closing(Closing 2), This will make up Session 1, Session 2 will be the next corresponding groups of Opening = 1 - Closing = 2 Thanks for the help in advance, hopefully this is understandable
-
So here is my dilemma, rather then describe it I will show you it. Let say we take back a certain amount of records records from the DB Called Inventory Count and they have a corresponding number attached to them indicating if they are an opening Count (1) or a closing count (2) Date-Product-Quantity-Opening/Closing 1. 1/1/2010, Ice Cream Cones, 10, 1 2. 1/1/2010, Bananas, 8, 1 3. 1/1/2010, Chocolate Bars, 9, 1 4. 2/1/2010, Ice Cream Cones, 5, 2 5. 2/1/2010, Bananas, 4, 2 6. 2/1/2010, Chocolate Bars, 3, 2 7. 4/1/2010, Ice Cream Cones, 12, 1 8. 4/1/2010, Bananas, 8, 1 9. 4/1/2010, Chocolate Bars, 9, 1 10. 5/1/2010, Ice Cream Cones, 1, 2 11. 5/1/2010, Bananas, 2, 2 12. 5/1/2010, Chocolate Bars, 3, 2 I need to build a dictionary that will take the first group (Openings = 1) and do the subtraction of quantity for closing(Closing 2), This will make up Session 1, Session 2 will be the next corresponding groups of Opening = 1 - Closing = 2 Thanks for the help in advance, hopefully this is understandable
You say that you want to build a dictionary. Are you under instruction to use a Dictionary? It seems, from what you have posted that this should all be done in the database.
Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.” I wouldn't let CG touch my Abacus!