It's a an Order Processing related query. There is a sales order which will have different products with some specific quantity. Each qty will have schedule for delivery. In this case, for 55 nos it has the schedule as 10, 15, 30. same way it has once more set of schedule. In Sales details table you get detail of the material sold against each item. You will get details like sale order no and item line no. We need to take schedule qty in FIFO basis and allocate the required qty. I need to get a result set as shown and have to update the sales order detail table. Please help me Screenshot
Asked
Active
Viewed 338 times
0
-
Are you trying to write a query? Can you describe what you want your output to look like? – Jerrad Jun 27 '14 at 13:01
-
Please Check the screen shot once. – Sandeep Mogaveer Jun 27 '14 at 13:04
-
Ya i need a stored procedure for this – Sandeep Mogaveer Jun 27 '14 at 13:09
-
Can you describe your columns? Where does `allocated` come from? Why are there two `Sales Order Details`? – Jerrad Jun 27 '14 at 13:18
-
Sales Order schedule is the plan for delivery of the material... Once the material is sold, obviously scheduled qty should decrease based on the sold qty. So one is sales Order details before selling the material and another one is final result what i want... So my result set, it should also update the sales order detail accordingly. – Sandeep Mogaveer Jun 27 '14 at 14:37
1 Answers
0
Resolved Myself. Need to make use of Loops and allocate the quantities to the Delivery schedules.

Sandeep Mogaveer
- 57
- 1
- 12