L ludao Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-04 #1 我想统计query查出来的全部记录的同一个字段“金额”(类型为货币型)的字段值的 和,放到Edit框里,要怎么做?(要类型转换) 谢谢!
J jsxjd Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-04 #2 query.first edit.text:=query.fieldbyname('...').asstring
A abc1abc Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-04 #3 with query do begin SQL.Clear; SQL.Add('select sum(money) from yourtable'); ExecSQL; Active := True; edit.text := Fields[0].AsString; Close; end; then ok
with query do begin SQL.Clear; SQL.Add('select sum(money) from yourtable'); ExecSQL; Active := True; edit.text := Fields[0].AsString; Close; end; then ok
心 心情 Unregistered / Unconfirmed GUEST, unregistred user! 2002-09-04 #4 var nsum;single with query do begin first while not eof do begin nsum:=nsum+filebyname('金额').value; next; end; end; edit.text:=floatTostr(nsum);
var nsum;single with query do begin first while not eof do begin nsum:=nsum+filebyname('金额').value; next; end; end; edit.text:=floatTostr(nsum);