Subject Re: Question on Month date range in SELECT statements
Author Anderson Farias
"mspencewasunavailable" <firebird@...> wrote:

> You want EXTRACT. This works for me:
>
> select count(*) from sometable
> where EXTRACT(MONTH from timestampfield)
> <> Extract(MONTH from CURRENT_DATE)
>

Althougt this is true, the problem here is that extract won´t let fb
use an index for the search and, as stated initially the table has
milions of records so this can be very ineffective.

a between 'first-day-of-month' and 'first-day-of-next-month' whould
be more effient. or, have a 'month' collum filled by triggers.

just a thought

Regards,
Anderson Farias