var strSQl:string; begin strSQLl:='select count(*) from (select sells_jhdh from sells'+' where(datediff(dd,sells_tjsj,sells_zrsj)*24)<6 group by sells_jhdh ) as a'end;
adoquery1.close; adoquery1.sql.text:='select count(*) as col1 from ( ' +'select sells_jhdh from sells where (datediff(dd,sells_tjsj,sells_zrsj)*24)<6 ' +'group by sells_jhdh ) as a '; adoquery1.open; edit1.text:=adoquery1.fieldbyname('col1').asstring;
strSQl:string;
begin
strSQLl:='select count(*) from (select sells_jhdh from sells'+' where(datediff(dd,sells_tjsj,sells_zrsj)*24)<6
group by sells_jhdh ) as a'end;
2.將結果集賦給edit...
adoquery1.close;
adoquery1.sql.text:='select count(*) as col1 from ( '
+'select sells_jhdh from sells where (datediff(dd,sells_tjsj,sells_zrsj)*24)<6 '
+'group by sells_jhdh ) as a ';
adoquery1.open;
edit1.text:=adoquery1.fieldbyname('col1').asstring;
string长度限制255