blueparaiba
Programmer
GID Node Ref Item Date Qty
0 32320 6 0 2008-11-01 00:00:00.000 8
0 32320 6 1 2009-03-01 00:00:00.000 10
0 32320 6 2 2009-05-01 00:00:00.000 6
0 32320 6 3 2009-12-01 00:00:00.000 6
0 32320 6 4 2010-06-01 00:00:00.000 6
0 32320 6 5 2010-07-01 00:00:00.000 12
0 32320 23 0 2008-11-01 00:00:00.000 17.38
0 32320 23 1 2009-03-01 00:00:00.000 17.38
0 32320 23 2 2009-05-01 00:00:00.000 17.38
0 32320 23 3 2009-12-01 00:00:00.000 17.38
0 32320 23 4 2010-06-01 00:00:00.000 20.45
0 32320 23 5 2010-07-01 00:00:00.000 20.45
Results
I am trying to get the maximum(Date) from the reference 6 to calculate the quantity against the date in reference 23 where the (maximum(Date) from reference 6) is <= Date in Reference 23, and then the cycle repeats again taking the next maximum date in reference 6. For example:
The maximum date in reference 6 is:
GID Node Ref Item Date Quantity
0 32320 6 5 2010-07-01 00:00:00.000 12
This date will then compare it in reference 23:
0 32320 23 5 2010-07-01 00:00:00.000 20.45
The date should be either equal or close to the maximum date in reference 6. Then the two quantity can be multiple together, giving a forecasted quantity 12*20.45=245.40 and then the cycle repeats again. How can I accomplish this take?
0 32320 6 0 2008-11-01 00:00:00.000 8
0 32320 6 1 2009-03-01 00:00:00.000 10
0 32320 6 2 2009-05-01 00:00:00.000 6
0 32320 6 3 2009-12-01 00:00:00.000 6
0 32320 6 4 2010-06-01 00:00:00.000 6
0 32320 6 5 2010-07-01 00:00:00.000 12
0 32320 23 0 2008-11-01 00:00:00.000 17.38
0 32320 23 1 2009-03-01 00:00:00.000 17.38
0 32320 23 2 2009-05-01 00:00:00.000 17.38
0 32320 23 3 2009-12-01 00:00:00.000 17.38
0 32320 23 4 2010-06-01 00:00:00.000 20.45
0 32320 23 5 2010-07-01 00:00:00.000 20.45
Results
I am trying to get the maximum(Date) from the reference 6 to calculate the quantity against the date in reference 23 where the (maximum(Date) from reference 6) is <= Date in Reference 23, and then the cycle repeats again taking the next maximum date in reference 6. For example:
The maximum date in reference 6 is:
GID Node Ref Item Date Quantity
0 32320 6 5 2010-07-01 00:00:00.000 12
This date will then compare it in reference 23:
0 32320 23 5 2010-07-01 00:00:00.000 20.45
The date should be either equal or close to the maximum date in reference 6. Then the two quantity can be multiple together, giving a forecasted quantity 12*20.45=245.40 and then the cycle repeats again. How can I accomplish this take?