Can anyone help me transform the above into a cursor with all the possible sum combinations of decimal values that will be inputed in the function?
Case:
I have a variable number of pallets that have different total weights.
Each pallet in the dataset belongs to the same order.
the order requires part of the total quantity available.
i.e. total stock is 5 pallets with 100.2 , 120.34 , 123.54, 82.23, 98.45 kgs respectively.
The Order requires only 202 kg.
Required:
Find the best combination of sums that comes closer to the order requirement.
[In this case it should be the combination of pallets 2 & 4 ( 120.34 + 82.23 = 202.57)]
Possible solution:
Based on the above function, alter it in order to create a cursor (or temp table) with every possible sum combination of the inputed pallet weights possible and then pick the nearest value to the ordered one.
Can anybody help me ?
Thanx in advance