Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add up the values of 1 field in all records 1

Status
Not open for further replies.

DelphiAaron

Programmer
Jul 4, 2002
826
AU
is there a way to keep a live tally of a database field at runtime ?

Aaron Taylor
John Mutch Electronics
 
I don't think so. 'GroupBy' queries don't actually contain any records from the dataset. The best you can do is be aware of when changes to the dataset are made, and then recalculate your query.

There are ways to get around this though - for example, if your dataset contains a unique incremental field, like an AutoNumber, or transaction number, then you could remember the highest number, and only re-query for the new records, and add the results with the previous GroupBy query. If your GroupBy query takes a long time to compile, this sort of approach may give good performance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top