begin with dm.ADOQuery1 do begin close; sql.Clear; sql.Text:='select sum(chanpin_shu*chanpin_price) as cg from chanpin,edit where chanpin.ht_num=edit.ht_num and edit.ht="采购合同"'; //计算总收入 open; form5.Label5.Caption:=string(FieldValues['cg'])+' 元'; end; end;
----------------------------------------------
我是菜鸟!
begin with dm.ADOQuery1 do begin close; sql.Clear; sql.Text:='select sum(chanpin_shu*chanpin_price) as cg from chanpin,edit where chanpin.ht_num=edit.ht_num and edit.ht="采购合同"'; //计算总收入 try open; except execsql; end; if dm.ADOQuery1.RecordCount>0 then form5.Label5.Caption:=string(FieldValues['cg'])+' 元' else form5.Label5.Caption:='0 元'; end; end; 还那样啊!
----------------------------------------------
我是菜鸟!