我现在想实现这样一个更能,首先是对一个数据库进行查询,查询的同时并对其进行统计功能,并把统计的结果显示在文本框里。

解决方案 »

  1.   

    Read 是个函数!et_money.Text:=Read(et_code.Text);
      

  2.   

    楼主想要什么呢? 是要查询统计的SQL语句吗?
      

  3.   

    with adoquery1 do
    begin
    close;
    sql.clear;
    sql.add('select 部门名称,sum(工资) as gz from 表名 group by 部门名称');
    open;
    text1.text:=strtoint(fieldbyname(gz).asinteger);
    end;
      

  4.   

    query.close;
    query.sql.text:='select sum(a) from table1 where ....';
    query.open;
    edit1.text:=query.fields[0].asstring;如果你返回一个数据集合的话,就一条一条写到edit里面吧,不过edit好象是有长度限制,大概255