running total - timesheet

Results 1 to 2 of 2

Thread: running total - timesheet

  1. #1
    Join Date
    Dec 1969

    Default running total - timesheet

    background:<BR>-----------<BR>i have a looper that goes in to the database, retrieves the number of hours the person had worked and gives a total of all hours worked at the end. there are multiple accounts that any given person might have, however, the total at the end adds all hours for all accounts.<BR><BR>problem:<BR>--------<BR>I would like to make a sub-total for each account befor they are added to the final total.<BR><BR>example<BR>-------<BR><BR>acct 1 = 15 hours<BR>acct 1 = 10 hours<BR>subt l = 25 hours &#060;-----needed (sub total)<BR> <BR>acct 2 = 10 hours<BR>acct 2 = 05 hours<BR>subt 2 = 15 hours &#060;-----needed (sub total)<BR><BR>total = 40 hours<BR><BR>question<BR>--------<BR>so how can i get a sub total from the asp values? is it best to add a new rs, or somehow set this in an array?<BR><BR>Any comments appreciated.<BR>Sam<BR>

  2. #2
    PlatQ Guest

    Default RE: running total - timesheet

    If you use the GetRows method of the recordset object, it will dump the entire resultset into a multi-dim array. As long as you ORDER BY in your query, you can just step through the array, keeping a sub-total based on acccount. When the Account ID changes write out the subtotal, reset it, and continue through the array.

Posting Permissions

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