Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Feb 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calculating database output in ASP(VB)

    Hi,

    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

  • #2
    Regular Coder
    Join Date
    Jul 2004
    Location
    France
    Posts
    141
    Thanks
    0
    Thanked 0 Times in 0 Posts
    dim t
    dim total

    t = 0

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

    total = t
    Last edited by gwendaal; 02-03-2005 at 08:35 AM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •