uses DateUtils;
....
procedure TForm1.Button1Click(Sender: TObject);
var date1,date2:TDate;
m,d:integer;
begin
date1:=StrToDate('2003-06-02');
date2:=StrToDate('2008-06-04');
if date1>date2 then
begin
ShowMessage('日期大小不对。');
exit;
end;
m:=MonthsBetween(date1,date2);
if incmonth(date1,m)<>date2 then
begin
d:=Trunc(date2-incmonth(date1,m));
ShowMessage('相差'+IntToStr(m)+'月'+IntToStr(d)+'日');
end
else
ShowMessage('相差'+IntToStr(m)+'月');
end;