June 8, 2010 at 1:53 pm
So I have the following syntax:
Select
i.Amount as Balance
From
ARHeader h
join ARDetail d on h.Voucher = d.Voucher and h.CompCode = d.CompCode
join ARItem i on d.[LineNo] = i.[LineNo] and d.Voucher = i.Voucher
Where
i.CompCode='Will' and h.AID=475568982 and d.TransNo=0
Except that I need i.Amount to be displayed as a rolling total for every row. I've tried a million syntaxes and I just can't figure it out
June 8, 2010 at 2:03 pm
If you can provide some sample data and table structure that would help us help you.
Dan
If only I could snap my figures and have all the correct indexes apear and the buffer clean and.... Start day dream here.
June 8, 2010 at 2:08 pm
it contains sensitive material, can i show you an example?
June 8, 2010 at 2:09 pm
June 8, 2010 at 2:12 pm
Please read the best article ever written for running totals on SQL Server[/url] by MVP Jeff Moden.
If you still need assistance, please read the first link in my signature for how you can help us help you get better, tested answers faster.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
June 8, 2010 at 3:58 pm
omri.wallach (6/8/2010)
So I have the following syntax:Select
i.Amount as Balance
From
ARHeader h
join ARDetail d on h.Voucher = d.Voucher and h.CompCode = d.CompCode
join ARItem i on d.[LineNo] = i.[LineNo] and d.Voucher = i.Voucher
Where
i.CompCode='Will' and h.AID=475568982 and d.TransNo=0
Except that I need i.Amount to be displayed as a rolling total for every row. I've tried a million syntaxes and I just can't figure it out
Omri,
It doesn't have to be real data. Just a representation of the problem. Don't assume that you know how to post it, though. See the article at the first link in my signature line below. If you post data and a table creation as outlined in the article, people will trip over each other trying to help.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 8, 2010 at 3:58 pm
WayneS and bteraberry... thanks for the great kudo. :blush:
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply