var
SelectedData : TDate;
Ok : Boolean;
// ...
SelectedData := (Sender as TDBDateTimeEditEh).Value;
Ok := (IncYear(Now, 5) >= SelectedData) and (IncYear(Now, -5) <= SelectedData);
var
SelectedData : TDate;
Ok : Boolean;
// ...
SelectedData := (Sender as TDBDateTimeEditEh).Value;
Ok := (IncYear(Now, 5) >= SelectedData) and (IncYear(Now, -5) <= SelectedData);
Uses ..., DateUtils;