有一个关于ADOquery的增加行数的问题!帮帮忙~~~~ 找药品免费进销存软件
仓库管理软件版1楼: 例如adoquery中有个列是为“金额”
怎样把这个列“金额”中的数据一行行的加起来??
如:
for i=0 to adoquery.recordcount-1 to
if trim( 这里面怎填? )<>'''' then
begin
s=s+strtofloat(adoquery.fieldbyname(''金额'').value);
end;
怎样把这个列“金额”中的数据一行行的加起来??
如:
for i=0 to adoquery.recordcount-1 to
if trim( 这里面怎填? )<>'''' then
begin
s=s+strtofloat(adoquery.fieldbyname(''金额'').value);
end;
2楼: s := 0;
adoquery.First;
while not adoquery.Eof do
begin
s := s + adoquery.FieldByName(''金额'').AsInteger;
adoquery.Next;
end; 如药品免费进销存软件
3楼: var
cySum:currency;
with adoQuery do
begin
while not eof do
begin
cySum:=cySum+fieldbyname(''金额'').ascurrency;
next;
end;
end;
4楼: 用个查询不行吗?
select sum(金额) as 金额 from TableName
5楼: 干净利落:select sum(金额) as 金额 from TableName
6楼: Dbgrideh自动求和
仓库管理软件版7楼: 接受答案了.