Re: datetime fields, take two
Posted in 1996
Jon Drukman wrote:
>
> does anybody have a list of functions that are available for querying
> DATETIME fields? i already knew about year(), month() and day(). i was
> hoping there would be a corresponding hour(), minute() and second() but
> there doesn't appear to be. at least, when i try: select * from table
> where hour(datetimefield)=13, i get 674: Procedure (hour) not found.
>
There isn't a list of functions associated with DATETIME; instead use
EXTEND with appropriate parameters:
SELECT * FROM TABLE WHERE EXTEND(datetimefield, HOUR TO HOUR) =
EXTEND("13", HOUR TO HOUR)
worked for me.
> please someone, tell me it is possible to query on the time part, or i'm
> really screwed!
You're probably still really screwed, but not because you can't query on
the time part.
//////////////// =======================================================
////////// // Dennis J. Pimple Informix Software, Inc.
////// / /// Principal Consultant 5299 DTC Blvd Suite 740
///// // //// dennisp@informix.com Englewood CO 80111
//// // /////
/// // ////// recept: 303-850-0210
// // /////// direct: 303-740-5611 Opinions expressed are mine,
/ /////////// fax: 303-843-6408 and do not necessarily
//////////////// http://www.informix.com reflect those of my employer