Subject Re: SQL Date Question
Author gerbreown@mindspring.com
That is another solution that I hadn't thought about. Like THEY say,
"There are numerous ways to skin a cat..." I knew that if I posted
my
question here someone would have (numerous) simple solutions.

Thanks to all.

Gerald S. Brown

--- In IBDI@egroups.com, "Ivan Prenosil" <prenosil@m...> wrote:
> > 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.
>
> Using EXTRACT looks nice, but has disadvantage that it can't use
index.
>
> What about this simple solution (no need to know "month size"):
>
> WHERE (field >= '8/1/2000') AND (field < '9/1/2000')
>
> (unlike BETWEEN, it works on both DATE and TIMESTAMP type of fields)
>
>
> Ivan
> prenosil@m...