• ahh that would help right saravanatn lol, sorry

    the output i would like is:
    Order-------part--------Quantity---------Onhand-------PO--------remaining
    1------------   1     ---------5------------------8-------------null---------3
    2---------------1-------------3------------------3-------------null---------0
    3--------------1--------------2------------------0------------1-------------  -1  - the reason its negative 1 is because the first purchase order couldnt cover the order 3, because order 3 required 2, but the po only had 1
    3--------------1--------------2------------------0------------2-------------2  ----------the 2nd po, or Purchase order 2, had quantity 3, but since the first PO couldnt cover it, the 2nd po did...

    just thinking, is it possible that sql could handle this kind of calculation, maybe i need to rethink and see if a developer can accomplish this?

    thanks again and sorry for the missing info and if the dash (-) thrwos you off, i am not sure how to post a table besides maybe a screen shot?