time query
Posted in 2006
Topics: General Discussion
Hello I'm using Informix and I have to limit a search by a field that is of type "datetime hour to minute" what is the correct sintax for searching for example after 3pm thanks a Lot
Assuming today,
select * from table
where datetime_column > "15:00";
-Dave
-----Original Message-----
From: informix-list-bounces@iiug.org
[mailto:informix-list-bounces@iiug.org] On Behalf Of luissol
Sent: Friday, October 06, 2006 1:31 PM
To: informix-list@iiug.org
Subject: time query
Hello
I'm using Informix and I have to limit a search by a field that is of
type "datetime hour to minute"
what is the correct sintax for searching for example after 3pm
thanks a Lot
_______________________________________________
Informix-list mailing list
Informix-list@iiug.org
http://www.iiug.org/mailman/listinfo/informix-list
luissol wrote:
> I'm using Informix and I have to limit a search by a field that is of
> type "datetime hour to minute"
>
> what is the correct sintax for searching for example after 3pm
IDS uses 24-hour clock notation, so 3pm is 15:00. Hence, for a DATETIME
HOUR TO MINUTE column:
SELECT * FROM SomeTable
WHERE SomeColumn > DATETIME(15:00) HOUR TO MINUTE
Given IDS's willingness to do conversions for you, you can also use Dave
Buchholz's suggestion. If the underlying column was actually DATETIME
YEAR TO SECOND, you'd need to express the question more precisely (is it
after 3pm today, or yesterday, or everyday, or ...) and you'd probably
use a longer expression too.
--
Jonathan Leffler #include <disclaimer.h>
Email: jleffler@earthlink.net, jleffler@us.ibm.com
Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/