Subject Re: [ib-support] Problems with a date field in a query
Author Martijn Tonies
Hi Xavier,

> Hello,
>
> I have a table with a field which is a date, and now I want to make a
query that returns all the rows in which the month of this field is March
(for example). The date is stored in the mm/dd/yyyy format. I have tried
this:
>
> SELECT * from my_table
> WHERE my_date_field LIKE '03%'
>
> But it doesn't work (the query returns 0 rows). How can I do it?

If you're using IB6, why don't you try:

SELECT * from my_table
WHERE extract(month from my_date_field) = 3

Martijn Tonies
InterBase Workbench - the developer tool for InterBase and Firebird
http://www.interbaseworkbench.com

Upscene Productions
http://www.upscene.com

"This is an object-oriented system.
If we change anything, the users object."