不太明白你的意思。
你是指把返回数据集中所有的记录都显示出来吗?while not query1.eof() do
begin
.... (do something)
query1.next;
end;如果想检查到底是否返回了多条记录,在 SQL Explorer中检查一下你的SQL语句
你是指把返回数据集中所有的记录都显示出来吗?while not query1.eof() do
begin
.... (do something)
query1.next;
end;如果想检查到底是否返回了多条记录,在 SQL Explorer中检查一下你的SQL语句
with query1 do
begin
close;
with sql do
begin
clear;
add('select 业务员,sum(金额) from xiaoshou.db group by 业务员');
query1.open;
query1.first;//add
while not query1.eof() do//add
begin//add
if query1.FieldByName('业务员').value='001' then
edit1.text:=fieldbyname('sum of 金额').asstring
if query1.FieldByName('业务员').value='002' then
edit2.text:=fieldbyname('sum of 金额').asstring;
if query1.FieldByName('业务员').value='003' then
edit3.text:=fieldbyname('sum of 金额').asstring
if query1.FieldByName('业务员').value='004' then
edit4.text:=fieldbyname('sum of 金额').asstring;
query1.next;//add
end;//add
end;
end;
end;