Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread DAY + MONTH functions
Mon, Feb 6 2006 10:41 AMPermanent Link

"Jack Marsh"
Hi,

I am trying to write a query that will select all contacts whose birthday
falls between a specified period.  So I am trying to ignore the year and
search using day and month only; however, I don't seem to be able to get
DBISAM to accept my query.

For example to find every contact whose birthday is in April I thought that
I could do the following:

SELECT ContactCode FROM Contacts WHERE MONTH(Birthday) = 4;

However, this won't parse.  How do I implement the DAY and MONTH functions?

Thanks,
Jack

Mon, Feb 6 2006 11:36 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jack,

<< However, this won't parse.  How do I implement the DAY and MONTH
functions? >>

You're close. SmileyWhat you want to use is the EXTRACT() function:

SELECT ContactCode FROM Contacts WHERE EXTRACT(MONTH FROM Birthday) = 4;

--
Tim Young
Elevate Software
www.elevatesoft.com




Mon, Feb 6 2006 11:42 AMPermanent Link

"Jack Marsh"
Thanks Tim

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:707EBBD2-9FA2-4DB1-A38D-D0858252E42E@news.elevatesoft.com...
> Jack,
>
> << However, this won't parse.  How do I implement the DAY and MONTH
> functions? >>
>
> You're close. SmileyWhat you want to use is the EXTRACT() function:
>
> SELECT ContactCode FROM Contacts WHERE EXTRACT(MONTH FROM Birthday) = 4;
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
>
>
>
>

Image