I'm crazy! Help me! Expert help! How can we obtain the sum (total) value in the database? Thank you! Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiDB/html/delphi_20061221102432192.html
The following section Program !
Self. query1.close;
Self. query1. SQL. Clear;
Self. query1. SQL. Text: = 'select distinct sum (total) from gzlb ';
Self. query1.open;
How can I obtain the sum (total) Cost-effective result value? Put it in a variable?
Expert help! Help!
Self. query1.close;
Self. query1. SQL. Clear;
Self. query1. SQL. Text: = 'select distinct sum (total) from gzlb ';
Self. query1.open;
Mysum: = self. query1.fields [0]. asfloat;
Agree to '~ You can also use an alias.
SQL. Text: = 'select distinct sum (total) as sum1 from gzlb ';
Edit1.text: = query1.fieldbyname ('sum1'). asstring;
Solution!
Everybody gets used to it.
Points.
Didn't I close the post in time?