Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

INVENTORY ONE TABLE CREATE HOW TO BALANCE QTY CARRY IN NEXT ROW Expand / Collapse
PLEASE HELL ME SOLVE MY PROBLEM
Poll ResultsVotes
UPDATE MY_TABLE
0%
0
0%
0
SET BALANCE_QTY=OB_QTY+RECD_QTY-ISSUE_QTY
0%
0
0%
0
Member Votes: 0, Anonymous Votes: 0. You don't have permission to vote within this poll.
Author
Message
Posted Tuesday, February 22, 2011 12:42 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, April 30, 2011 10:09 AM
Points: 1, Visits: 37
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

 

 

Post #1067843
Posted Tuesday, February 22, 2011 12:55 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 5:03 AM
Points: 12,744, Visits: 31,067
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1067851
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse