while d1 < d2 do
begin
kkk := FormatDateTime('yyyy-mm', d1); // 得到年月信息。
// kkk := Int(d1); // 得到年月信息。
IncMonth(d1);
end;//IncMonth(d1, 12); //+1年
begin
kkk := FormatDateTime('yyyy-mm', d1); // 得到年月信息。
// kkk := Int(d1); // 得到年月信息。
IncMonth(d1);
end;//IncMonth(d1, 12); //+1年
d1,d2:Tdate;
begin
d1:=strtodate('2000-12-1');
d2:=strtodate('2002-3-1');
while d1<=d2 do
begin
//dosomething;
IncMonth(d1,1);
end;
end;