with LaobaoFFQuery do
begin
CommandText:='select * from LBPFFB where FFBJ=1 and ZTBZ=0';
Open;
while not Eof do
begin
{(1)对每条记录,从中查出一些字段,来做为下面Append的值}
v1:=LaobaoFFQuery.FieldByName('SCFFRQ').AsDateTime; // 上次发放日期
。。。。
{(2)添加数据记录}
Append; //添加数据
FieldByName('GUID').AsString := JSCommon.CreateGUIDStr;
FieldByName('ZG').AsString:=ZG;
。。。。
Next;
end; // while not Eof do
ApplyUpdates; //LaobaoFFQuery.ApplyUpdate
end;// with LaobaoFFQuery do begin
finally
LaobaoFFQuery.Free;
end; //Try
try
with LaobaoFFQuery do
begin
CommandText:='select * from LBPFFB where FFBJ=1 and ZTBZ=0';
Open;
while not Eof do
begin
v1:=LaobaoFFQuery.FieldByName('SCFFRQ').AsDateTime; // 上次发放日期
if(FieldByName('ZTRQ').IsNull) then
v2:=0.0
else
v2:=FieldByName('ZTRQ').AsDateTime; //暂停日期
if (FieldByName('QYRQ').IsNull) then
v3:=0.0
else
v3:=FieldByName('QYRQ').AsDateTime; //启用日期