Basically I am creating a sort of checking account type query. Which would be fairly easy except I want it split into pages.
So I have a field that is called amount
and it can be a positive or a negative number.
The problem is if I am on records 75-100 I need to have a query sum all of amount
up until record 75 and give me the total.
Then I can run my query for records 75-100 and loop through their amounts like so:
(supposing that the sum up to and including 74 was $500)
record# Amount Total
75 25.00 525.00
76 35.00 560.00
77 40.00 600.00
etc.
What I was thinking was to get the idnum for record 75 and sum up until it finds it like so:
SUM(case when idnum
!= $until then amount
else 0 end)
However this just keeps going. It doesn't stop at 75 it just skips 75 then sums 76, 77, etc.. Any help would be appreciated.