Subject | Re: [firebird-support] select birthdays form the next several days |
---|---|
Author | Magnus Titho |
Post date | 2005-09-23T08:44Z |
Christian Brümmer wrote:
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.)
Magnus
>And now a simple question: how can a get with a simple SQL statement theselect Birthday
>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?
>
>
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