Subject | Re: select birthdays from the next several days |
---|---|
Author | davidalbiston |
Post date | 2005-09-23T11:14:25Z |
I was thinking along the lines of
where cast(Extract(Year from current_date) ||'-'|| Extract(Month from
DoB) ||'-'|| Extract(Day from DoB) as date)
between current_date and current_date + 13
This fails if the birthday is 29th February and the current year is
not a leap year. To handle those, I think you cannot avoid a stored
procedure.
Dave
--- In firebird-support@yahoogroups.com, Christian Brümmer
<christian@b...> wrote:
where cast(Extract(Year from current_date) ||'-'|| Extract(Month from
DoB) ||'-'|| Extract(Day from DoB) as date)
between current_date and current_date + 13
This fails if the birthday is 29th February and the current year is
not a leap year. To handle those, I think you cannot avoid a stored
procedure.
Dave
--- In firebird-support@yahoogroups.com, Christian Brümmer
<christian@b...> wrote:
> Hi all,extract(day
>
> thanks for all your answers:
>
> >>select Birthday
> >>from Persons
> >>where cast('2000-' || extract(month from Birthday) || '-' ||
> >>from Birthday) as date) between [...]
>
> I'm sorry to say, that this will fail during the end of the year.
>
> Any other ideas or improvements?
>
> Best regards
>
> Christian