Subject Re: [firebird-support] Re: select birthdays form the next several days
Author Arno Brinkman
Hi,

> bdate between
>
> cast( extract(day from current_date) -
> (case when extract(day from current_date)=29 and extract(month
> from current_date)=2 then 28 else 0) ||
> '.'||extract(month from current_date) +
> (case when extract(day from current_date)=29 and extract(month
> from current_date)=2 then 1 else 0)||
> '.'||extract(year from bdate) as date)
<snip>

> Theorically it should be do index scan.

No, because bdate is used at the left and right side in the comparisons.

Regards,
Arno Brinkman
ABVisie

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
General database developer support:
http://www.databasedevelopmentforum.com

Firebird open source database (based on IB-OE) with many SQL-99 features:
http://www.firebirdsql.org
http://www.firebirdsql.info

Support list for Interbase and Firebird users:
firebird-support@yahoogroups.com

Nederlandse firebird nieuwsgroep:
news://newsgroups.firebirdsql.info