Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
1)Table1:
Tag Date Openingqty GRDate
AAA 21/11/2010 170 22/11/2010
2)Table 2:
Tag BillDate qty Price GRDate
AAA 11/11/2010 80 50 22/11/2010
AAA 10/11/2010 90 40 22/11/2010
AAA 09/11/2010 20 30 22/11/2010
Query:
Based on above two tables i want to sum price based on latest bill date wise. As per the example total qty is 170 and this qty is satisfied from first two rows of 2nd table so no need to considered 3rd row from 2nd table.
I want final output as;
Tag qty Price GRDate
AAA sum(80+90) (50+40) 22/11/2010
Plz suggest the solution:
Thanks,
Krutarth
Krutarth,
See attached solution.
Regards,