• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 258
  • Last Modified:

summing up a calculated field

What's the simplest way to sum up the values of a calculated field into a Tlabel or Tedit control?
1 Solution
You can use TQuery and

Query1.Active := False;
Query1.SQL := 'Select SUM(Your Calculation Formula) as SumResult FROM TableName WHERE something'
Query1.Active := True;
Edit1.Text := Query1.FieldByName('SumResult').AsString;
If you are talking about a Delphi Calculated field, I know of no means (in general) other than iterating through the recordset.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now