View Full Version : Calculating database output in ASP(VB)

02-03-2005, 08:16 AM

I am doing a simple credit & debit database for personal use.

Everything seems to be working fine except I am encountering a small problem.

In my reports, I have a report that displays my credit minus(-) my debit and shows the result in a do while loop. That works fine.

The problem is, for every month total(credit-debit), i want to take that total and add it to the next month.

For example.
Lets say, my total for each month is:
November $50
Decemeber $100
January $20

What I want to show is this new total:
November $50 (my starting month)
December $150 (50 + 100)
January $170 (150 + 20)

How do I do this?
When I loop it, i just get the total. But how can I add previous month totals to current month?

I am using ASP with VB script to program. My database is Access.

Thanks in advance

02-03-2005, 08:31 AM
dim t
dim total

t = 0

if (rsTemp.BOF = false) and (rsTemp.EOF = false) then
While (NOT rsTemp.EOF)
t = t + cint(rsTemp("price"))
end if

total = t