DECLARE @tmpTbl as table
(
ordNum varchar(10),
ordType varchar(4),
dlqAmt numeric(5,2),
pdAmt numeric(5,2),
rcvdDt datetime
)
INSERT @tmpTbl
VALUES
('5','ORG',0.00,101.32,'12/1/2013'),
('8','ADD',0.00,41.12,'12/18/2013'),
('11','ADD',32.17,17.19,'1/13/2014'),
('21','ADD',0.00,31.01,'1/28/2014'),
('92','ADD',0.00,0.92,'2/13/2014'),
('108','ADD',0.19,92.42,'2/21/2014'),
('317','ADD',0.00,13.11,'3/3/2014'),
('1010','ADD',0.00,4.08,'3/17/2014'),
('1713','ADD',0.00,11.06,'4/1/2014'),
('3010','ADD',22.97,2.19,'4/16/2014')
;with mycte as
(
select ordNum,
ordType,
dlqAmt,
rcvdDt,
sum(pdAmt) Over( Order by rcvdDt ) pdAmt from @tmpTbl)
Select * from mycte
Where dlqAmt<>0
Wednesday, April 1, 2015
Summing by row number
Labels:
big loop My VS C#
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment