Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Informix Datetime 1

Status
Not open for further replies.

dmaytum

Programmer
Mar 4, 2003
23
US
I'm trying to pull records which were created in the last 30 minutes, but I'm confused with Informix datetimes. My where statement is listed below.

row_date is a date type, starttime is a small integer, a typical value for startime is 1800.

WHERE
(hvdn.row_date = today -1 and (hvdn.starttime) < (current hour to minute))

Research on the web implies that Informix will automatically convert from a small integer to a datetime, but I get an error saying it is not possible to convert. Any help would really be appreciated.
 
And what about this ?
hvdn.starttime < 100*(current hour to hour) + current minute to minute

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Thanks for your reply. I appreciate it. I still get ..."an illegal operation against a datetime field" . I've tried some modifications, and tried to simplify the expression to find the offending operation. I'll play with it but if anyone has suggestions... Thanks again.
 
And what about this ?
hvdn.starttime < 100*((current hour to hour)||"") + ((current minute to minute)||"")

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
That bad boy works! Thanks very much. I really didn't think anyone would respond! It looks like you're concatenating a space. Can you explain why this is neccessary. I didn't see any refernce to this on Informix web sites. Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top