N
narduo
Unregistered / Unconfirmed
GUEST, unregistred user!
请看一下下面这个过程中为什么会出现那种错误(打星号的那一行)
function Tform15.GetKucunJiage:Real;
var
cksl,lyl:real;
begin
lyl:=Table1.FieldByName('数量').Asfloat;
query1.close;
query1.sql.add('Select * From rkmingxi A,ruku B Where B.发票号码=A.发票号码');
query1.sql.add('And A.物品编码=:wpbm And A.领用否<>:yi Order by B.购入日期');
query1.ParamByName('wpbm').Asstring:=Table1.FieldByName('物品编码').Asstring;
query1.ParamByName('yi').asstring:='1';
query1.open;
While not Query1.Eof do
begin
★ cksl:=query1.FieldByName('数量').Asfloat;//出错,FIELD数量找不到,为什么?
lyl:=lyl-cksl;
if lyl>0 then Query1.Next else Query1.Last;
end;
result:=query1.FieldByName('单价').Asfloat;
end;
function Tform15.GetKucunJiage:Real;
var
cksl,lyl:real;
begin
lyl:=Table1.FieldByName('数量').Asfloat;
query1.close;
query1.sql.add('Select * From rkmingxi A,ruku B Where B.发票号码=A.发票号码');
query1.sql.add('And A.物品编码=:wpbm And A.领用否<>:yi Order by B.购入日期');
query1.ParamByName('wpbm').Asstring:=Table1.FieldByName('物品编码').Asstring;
query1.ParamByName('yi').asstring:='1';
query1.open;
While not Query1.Eof do
begin
★ cksl:=query1.FieldByName('数量').Asfloat;//出错,FIELD数量找不到,为什么?
lyl:=lyl-cksl;
if lyl>0 then Query1.Next else Query1.Last;
end;
result:=query1.FieldByName('单价').Asfloat;
end;