J
John Ortt
I have created an Access Database to store information from my various bank
accounts and keep track of my finances.
Everything works great, except that I decided not to keep the balance data
on the sheet, only the transaction amount.
I figured it was easier to just add all the previous transaction amounts to
get the balance on any given date (and a single balance adjustment at the
start of the data).
I am regretting this choice now as the code I have created to do it takes
ages......
Does anybody have any bright ideas on how I could do it? (I have included
my code below for an example)
----------------------------------------------------------------------------
--
SELECT [Q
ata].TransDate, Sum([Q
ata].[TransAmount]*-1)
AS Amount, -1*
(SELECT SUM([TransAmount])
FROM [Q
ata] as [Q
ata_1]
WHERE [Q
ata_1].[TransDate] <= [Q
ata].[TransDate]
and [Q
ata_1].[Account]=[Q
ata].[Account])
AS Balance, [Q
ata].Account
FROM [Q
ata]
GROUP BY [Q
ata].TransDate, [Q
ata].Account;
(I then crosstab the returned data so I can chart it)
accounts and keep track of my finances.
Everything works great, except that I decided not to keep the balance data
on the sheet, only the transaction amount.
I figured it was easier to just add all the previous transaction amounts to
get the balance on any given date (and a single balance adjustment at the
start of the data).
I am regretting this choice now as the code I have created to do it takes
ages......
Does anybody have any bright ideas on how I could do it? (I have included
my code below for an example)
----------------------------------------------------------------------------
--
SELECT [Q


AS Amount, -1*
(SELECT SUM([TransAmount])
FROM [Q


WHERE [Q


and [Q


AS Balance, [Q

FROM [Q

GROUP BY [Q


(I then crosstab the returned data so I can chart it)