hi,
I need to write sp for selecting some places based on fifo order. My input is quantity so that SP return based on this quantity also. I mean if i give 100 and the first record is 70 only i need to return first and second record based on FIFO
Table1
ID Place Quantity CreatedDate
1 p1 100 2012-04-25
2 p2 50 2013-04-26
3 P3 25 2013-04-27
4 P4 100 2013-04-28
5 P5 75 2013-04-28
--If i give input quantity as 70 i only got P1
--if i give input quantity as 110 i got P1 and p2
Likewise based on the wuantity i need to get FIFO based places. FIFO is from CreatedDate.
Can anyone help to write SP for this?