首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

怎样用edit显示统计数据解决思路

2012-02-12 
怎样用edit显示统计数据想点击buttom1然后edit1显示 统计出表sale中的total在查询分析器中我使用了compute

怎样用edit显示统计数据
想点击buttom1然后edit1显示 统计出表sale中的total  
在查询分析器中我使用了compute sum(toeal)可以显示出来!但是不知怎样用edit1显示!
以下是buttom1代码:
procedure Tquerysale.Button1Click(Sender: TObject);
begin
dm.ADSsale.Close;
dm.ADSsale.CommandText:='select sale.*,goods.g_name from sale, goods where Sale.g_id=goods.g_id and S_date between '+#39+datetostr(datetimepicker1.Date)+#39+' and '+#39+datetostr(datetimepicker2.Date)+#39+'compute sum(total)';
dm.ADSsale.Open;
if dm.ADSsale.RecordCount<0 then
  application.MessageBox('没有销售记录,请确认日期!','商品销售查询',mb_ok+mb_iconerror+mb_applmodal);
end;
各位大大教教我应该怎样加啊?

[解决办法]
edit1.text:=dm.ADSsale.fieldbyname('统计字段名').asstring;

热点排行