Z zhengyoukang Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-19 #1 Query字段汇总后!如何把值赋给label控件显示!大虾帮忙! sum()后如何进行label1.caption:=query......
完 完颜康 Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-20 #2 你用的BDE连接的吧(TTable)? 换成ADO的(TADOTable) 问题解决,我以前遇到过的
萧 萧月禾 Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-21 #3 select sum() as SumField from tablename label1.caption := FloatToStr(Query1.fieldbyname(SumField).AsFloat)
select sum() as SumField from tablename label1.caption := FloatToStr(Query1.fieldbyname(SumField).AsFloat)
D Dephic Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-21 #5 不是很明白你的意思,如果SQL是select sum(field) as SumField 那就可以这样做了: Label1.caption := IntToStr(Query.fieldbyname(SumField).AsInteger); 或 Label1.caption := IntToStr(Query.Fields[0].AsInteger); 或 Label1.caption := Query.Fields[0].AsString;
不是很明白你的意思,如果SQL是select sum(field) as SumField 那就可以这样做了: Label1.caption := IntToStr(Query.fieldbyname(SumField).AsInteger); 或 Label1.caption := IntToStr(Query.Fields[0].AsInteger); 或 Label1.caption := Query.Fields[0].AsString;
Z zhaixiaobo Unregistered / Unconfirmed GUEST, unregistred user! 2002-04-21 #6 抄襲一下萧月禾大蝦的: query.close; query.sql.text:='select isnull(sum(field1),0) from tablename'; query.open; label1.caption:=query.fields[0].asstring;
抄襲一下萧月禾大蝦的: query.close; query.sql.text:='select isnull(sum(field1),0) from tablename'; query.open; label1.caption:=query.fields[0].asstring;