Hallo Tom,
select * from zeit
where datediff
(
date_add(now(), interval 7 day),
concat(year(now()),'-',month(birthday),'-',if(month(birthday) = 2 and day(birthday)= 29,28,day(birthday))
)
between 0 and 7or datediff
(
date_add(now(), interval 7 day),
concat((year(now())+1),'-',month(birthday),'-',if(month(birthday) = 2 and day(birthday)= 29,28,day(birthday))
)
between 0 and 7
;
nein, das berücksichtigt den Schalttag immer noch nicht korrekt:
Am 21. Februar eines Schaltjahres behauptet Dein Statement, eine am 29. Februar eines anderen Schaltjahres geborene Person habe innerhalb der nächsten 7 Tage Geburtstag.
Freundliche Grüße
Vinzenz