Subject Re: [firebird-support] select birthdays from the next several days
Author Federico Tello Gentile
Arno Brinkman wrote:
> SELECT
> PersonName,
> Birthday
> FROM
> Persons
> WHERE
> (EXTRACT(MONTH FROM Birthday) * 100) +
> EXTRACT(DAY FROM Birthday) BETWEEN
> (EXTRACT(MONTH FROM CURRENT_DATE) * 100) +
> EXTRACT(DAY FROM CURRENT_DATE) and
> (EXTRACT(MONTH FROM CURRENT_DATE + 14) * 100) +
> EXTRACT(DAY FROM CURRENT_DATE + 14)

This is the first time I see the extract(day from current_date).

Is that a function? I see it is used as one, but the parameters are
weird having the from keyword inside. Is that syntax only used to get
those values from dates and times?

EXTRACT is not in the interbase 6 languaje reference... (Or didn't see it).

select
extract(year FROM current_date) as y,
extract(month FROM current_date) as m,
extract(day FROM current_date) as d,
extract(hour FROM current_time) as h,
extract(minute FROM current_time) as m,
extract(second FROM current_time) as s
from rdb$database