VB Database access - keeping totals 
Author Message
 VB Database access - keeping totals

Can anyone help?  (Is this the right place to ask if anyone can help?)

I want to show a scrolling list of rows from a database, but want to
manipulate some fo the values to include running totals in the rows - i.e.
each row to contain a cell with the total of the corresponding cell above
plus a value from the current row.

Is that possible with a query, or do I have to resort to the recordset and
iterate through it then populate the cells manually, rather than using a
bound grid?

Any suggestions gratefully received!

Thanks.



Fri, 04 Jan 2002 03:00:00 GMT  
 VB Database access - keeping totals
Hi,

    You can use SQL Query to achive this see the following Query sample.

SELECT a.Nos, (select  SUM(Nos) AS total from Table1 Where Row <= a.Row) AS
Total
FROM Table1 AS a
ORDER BY a.Row;

Where Nos is the field for which you want the running total
Row is the field on which you want an order by a date or something. Here you
need to
order this output by some field or it wont work. If you dont have any field
to order by, You
might want to create one.

Hope This Helps

S{*filter*}


Quote:
> Can anyone help?  (Is this the right place to ask if anyone can help?)

> I want to show a scrolling list of rows from a database, but want to
> manipulate some fo the values to include running totals in the rows - i.e.
> each row to contain a cell with the total of the corresponding cell above
> plus a value from the current row.

> Is that possible with a query, or do I have to resort to the recordset and
> iterate through it then populate the cells manually, rather than using a
> bound grid?

> Any suggestions gratefully received!

> Thanks.



Fri, 04 Jan 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Running Totals, accessing the database fields outside of the selection formula

2. Access database keeps corrupting

3. JCN - KEEPING TRACKS OF ALL CHANGES TO RECORDS IN AN ACCESS DATABASE

4. New Product: Total Visual SourceBook for Access and VB

5. Access Database concurrent users in VB 4.0 application and Database Security

6. Access Database concurrent users in VB 4.0 application and Database Security

7. VB 6 Database and Access 2K Database Problem

8. Calculate total income, total expense and a company's profit and loss

9. Grand Total, Subtotal, Running Total

10. Grand Total, subtotal, running total

11. TOTAL (RUNNING TOTAL )

12. Adding different sorted totals into a grand total field

 

 
Powered by phpBB® Forum Software