Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • 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?
0
ziche
Asked:
ziche
1 Solution
 
mokuleCommented:
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;
0
 
gwalkeriqCommented:
If you are talking about a Delphi Calculated field, I know of no means (in general) other than iterating through the recordset.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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