INVENTORY ONE TABLE CREATE HOW TO BALANCE QTY CARRY IN NEXT ROW

  • MY DATE

    ITEM_NAME , CODE , DATE , OB_QTY , RECD_QTY , ISSUE_QTY BALANCE_QTY

    5 PR CABLE 05 01/04/10 25 0 0 25

    5 PR CABLE 05 02/04/10 0 2 0 2

    5 PR CABLE 05 03/04/10 0 0 2 -2

    10 PR CABLE 06 01/04/10 20 0 0 20

    10 PR CABLE 06 02/04/10 0 0 5 -05

     

    I WANT RESULT

     

    ITEM_NAME , CODE , DATE , OB_QTY , RECD_QTY , ISSUE_QTY BALANCE_QTY

    5 PR CABLE 05 01/04/10 25 0 0 25

    5 PR CABLE 05 02/04/10 0 2 0 27

    5 PR CABLE 05 03/04/10 0 0 2 25

    10 PR CABLE 06 01/04/10 20 0 0 20

    10 PR CABLE 06 02/04/10 0 0 5 15

     

    PLEASE HELL ME

     

     

  • consumable data for the next poster:

    With [MY DATE](ITEM_NAME , CODE , [DATE] , OB_QTY , RECD_QTY , ISSUE_QTY, BALANCE_QTY)

    AS

    (

    SELECT '5 PR CABLE','05','01/04/10','25','0','0','25' UNION ALL

    SELECT '5 PR CABLE','05','02/04/10','0','2','0','2' UNION ALL

    SELECT '5 PR CABLE','05','03/04/10','0','0','2','-2' UNION ALL

    SELECT '10 PR CABLE','06','01/04/10','20','0','0','20' UNION ALL

    SELECT '10 PR CABLE','06','02/04/10','0','0','5','-05'

    )

    SELECT * FROM [MY DATE]

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply