... und wenn du das hier umstrickst?
Delphi-Quellcode:
// Source: [url]http://www.mycsharp.de/wbb2/thread.php?threadid=74208[/url]
// Translated by DeddyH - Delphi-PRAXiS
// Useful. if you search for f.e. last thursday in August of 2009
function LastDayOfWeekOfMonth(year,month: Integer;DayOfWeek: TWeekDay):TDate;
var temp: TDate;
begin
temp := IncMonth(EncodeDateTime(year,month,1,0,0,0,0));
Result := IncDay(temp,(DayOfWeek - DayOfTheWeek(temp) + 7)
mod 7 - 7);
end;