var
Year, Month, Day: Word;
Year1, Month1, Day1: Word;
I: Integer;
MyDate: TDateTime;
begin
Memo1.Clear;
DecodeDate(StartOfTheMonth(Now), Year, Month, Day);
DecodeDate(EndOfTheMonth(Now), Year1, Month1, Day1);
for I := Day to Day1 do
begin
MyDate := EncodeDate((year), (month), i);
Memo1.Lines.Add(DateToStr(MyDate));
with Query do
begin
close;
Open;
Append;
FieldByName('日期').AsDateTime := MyDate;
Post;
end;
end;
end;
效果。