I have extracted two sets of data, the fist one shows sales order requirements, the green/red column indicates where we run out of finished stock.
6G33-L611B11-BE | 28/03/2011 00:00:00 | 14 | 14 | 56 | |
6G33-L611B11-BE | 04/04/2011 00:00:00 | 7 | 21 | 56 | |
6G33-L611B11-BE | 11/04/2011 00:00:00 | 14 | 35 | 56 | |
6G33-L611B11-BE | 09/05/2011 00:00:00 | 21 | 56 | 56 | |
6G33-L611B11-BE | 16/05/2011 00:00:00 | 21 | 77 | 56 | |
6G33-L611B11-BE | 13/06/2011 00:00:00 | 42 | 119 | 56 | |
6G33-L611B11-BE | 11/07/2011 00:00:00 | 21 | 140 | 56 | |
6G33-L611B11-BE | 15/08/2012 00:00:00 | 7 | 147 | 56 | |
The second table show internal works orders to replenish stock.
6G33-L611B11-BE | WO-067177 | 13/08/2010 00:00:00 | 8 | 8 |
6G33-L611B11-BE | WO-067643 | 18/04/2011 00:00:00 | 72 | 80 |
what I would like to show is sum of column 4 in table two as a column in table one where the date in table two is less than date in table one.
So the first three rows on table one would show 8, and the fourth row would show 80, further rows would show 0.
Is this possible?