sDate := ADOQuery1TS_FDATE.AsString;
tsDate := StrToDate(Copy(sDate,1,4) + '-' + Copy(sDate,5,2) + '-' + Copy(sDate,7,2));
for j := 1 to ADOQuery1CNT.AsInteger do begin
for i := 0 to ADOQuery1.RecordCount -1 do begin
With ADOQuery2 do begin
Close;
SQL.Clear;
SQL.Add('UPDATE STATUS ');
SQL.Add(' SET STATUS = ''0'' ');
SQL.Add(' WHERE DATE = ''' + FormatDateTime('yyyymmdd', tsDate) + ''' ');
SQL.Add(' AND NO = ''' + ADOQuery1.FieldByName('NO').AsString + ''' ');
ExecSql;
end;
end;
ADOQuery1.NEXT;
end;
tsDate := tsDate + 1;
end;
/////////////////////////////////////////////////////////////////////
이중for문은 언제나 헷갈린거 같아염..
고수님들의 답변 부탁드립니다. 꾸벅^^
for j := 1 to ADOQuery1CNT.AsInteger do
begin
ADOQuery1.first;
while not ADOQuery1.eof do
begin
With ADOQuery2 do
begin
Close;
SQL.Clear;
SQL.Add('UPDATE STATUS ');
SQL.Add(' SET STATUS = ''0'' ');
SQL.Add(' WHERE DATE = ''' + FormatDateTime('yyyymmdd', tsDate) + ''' ');
SQL.Add(' AND NO = ''' + ADOQuery1.FieldByName('NO').AsString + ''' ');
ExecSql;
end;
ADOQuery1.NEXT;
end;
tsDate := tsDate + 1;
end;