Subject Re: [firebird-support] select birthdays form the next several days
Author Magnus Titho
Christian Brümmer wrote:

>And now a simple question: how can a get with a simple SQL statement the
>name of the people, who will have birthday within the next 14 (for
>example) days. Is it possible to do this in a single SQL statement?
>
>

select Birthday
from Persons
where cast('2000-' || extract(month from Birthday) || '-' || extract(day
from Birthday) as date) between
cast('2000-' || extract(month from current_date) || '-' || extract(day
from current_date) as date) and
cast('2000-' || extract(month from current_date) || '-' || extract(day
from current_date) as date) + 13;

(I chose the year 2000 because it's a leap year, otherwise you could
encounter problems with 29.02.)


>Christian
>
>

--
Magnus