der nun hoffentlich richtige code ist:
yx := year(dx);
p1 := date_add(d1,0,0,0,yx - year(d1));
p2 := date_add(d2,0,0,0,yx - year(d2));
IF p2 >= p1 THEN
period := dx <= p2 AND dx >= p1;
ELSE
period := dx <= p2 OR dx >= p1;
END_IF;
(* revision history
hm 19. sep 2007 rev 1.0
original version
hm 20. sep 2007 rev 1.1
corrected a problem with leap year
*)