Subject Re: SQL Date Question
Author gerbreown@mindspring.com
Claudio,

I had tried using EXTRACT but guess that I didn't use the correct
syntax when I tried it. The way I solved the problem was by using
BETWEEN as in "WHERE field BETWEEN '8/1/2000' and '8/31/2000'". The
problem with this is that I then had to create a table with the
number
of days in each month so that I can get the correct last day of the
month. It looks like the EXTRACT route will be simpler to implement.

Thanks for the info.

Gerald S. Brown

--- In IBDI@egroups.com, "Claudio Valderrama C." <cvalde@u...> wrote:
> > -----Original Message-----
> > From: gerbreown@m... [mailto:gerbreown@m...]
> > Sent: Jueves 17 de Agosto de 2000 10:13
> >
> > My question is: How do I select records in an IB table where the
> > month and year of a date field = 8 and 2000 respectivaly.
> >
> > I have tried MONTH(field), DATEPART("m", field), EXTRACT MONTH
FROM
> > field and none of these functions work in IB.
>
> I posted something about basic functions in IB-Conversions when
dealing with
> general conversion from IB to MsSql. In IB6, you need
> where extract(month from field)=8
> and extract(year from field)=2000
>
> Extract() is available in IB6 in every dialect.
>
> C.