

\\--------------現在中間回圈沒有,所以很累--------------------
begin
inherited;
with adoquery1 do
begin
First;
while not Eof do
begin
Edit;
FieldByName('完成數').AsInteger :=StrToIntDef(FieldByName('Y501').AsString,0) +
StrToIntDef(FieldByName('Y502').AsString,0) +
StrToIntDef(FieldByName('Y503').AsString,0) +
StrToIntDef(FieldByName('Y504').AsString,0);
FieldByName('未完成').AsInteger:=StrToIntDef(FieldByName('訂單數').AsString,0) -StrToIntDef(FieldByName('完成數').AsString,0);
Next;
end;
First;
end;
\\-------------------------------------------------------
請各位幫幫忙!

uj5u.com熱心網友回復:
主要問題是Y501 是代表5月1日 6月,7月呢?我會累爬的!求各位大大指導一下!
uj5u.com熱心網友回復:
為什么不用sql 計算好返給 delphi 顯示呢?uj5u.com熱心網友回復:
while not Eof dobegin
try
Edit;
FieldByName('完成數').AsInteger :=StrToIntDef(FieldByName('Y501').AsString,0) +
StrToIntDef(FieldByName('Y502').AsString,0) +
StrToIntDef(FieldByName('Y503').AsString,0) +
StrToIntDef(FieldByName('Y504').AsString,0);
FieldByName('未完成').AsInteger:=StrToIntDef(FieldByName('訂單數').AsString,0) -StrToIntDef(FieldByName('完成數').AsString,0);
Next;
except on e:Exception do
ShowMessage(e.Message);
end; // try
end;// while not Eof do
//////因為您老人家設那幾列允許為空。空字符是不能轉正數D
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/24152.html
標籤:數據庫相關
