Assuming that your table includes a column defined as "Time DATETIME YEAR
TO MINUTE", possibly with a default or a NOT NULL constraint, I think that
what you are trying to do can be done by saying:
SELECT * FROM Table
WHERE EXTEND(Time, MONTH TO DAY) = DATETIME(7-16) MONTH TO DAY;
This picks out all the values in any year for the given date. If you only
want the current year, despite being given just the month and day, then
you'd have to use:
SELECT * FROM Table
WHERE Time = EXTEND(DATETIME(7-16) MONTH TO DAY, YEAR TO DAY);
This has the advantage that the optimizer should be able to use an index on
the Time column, if there is one.
Yours,
Jonathan Leffler (johnl@informix.com) #include <disclaimer.h>
>From: jsd@cyborganic.com (Jon Drukman)
>Date: Mon, 08 Jul 1996 12:56:49 -0700
>X-Informix-List-Id: <news.25874>
>
>this should be a simple one...
>
>i have a datetime (year to minute) column. how do i select all rows that
>have their datetime on a specific month and day only?
>
>select * from table where time=(extend datetime('7/16') year to minute);>
>is as close as i have gotten, and it doesn't work right.
>i'm pretty new to all this, so be kind to my mistakes. :)
>
>thanks
>jon