sql 问题
数据库是informix,有一个表test,其中有个inputtime字段,是DATETIME YEAR TO SECOND类型的,我想问一下如何实现下面的sql?
sql:
select inputtime,name
from test
where inputtime between '2008/01/01' and '2008/01/02';
这样执行sql报错:Non-numeric character in datetime or interval.
请问如何解决?急!谢谢!!!
[解决办法]
select inputtime,name
from test
where
TO_CHAR(inputtime,'%Y-%m-%d') between '2008-01-01' and '2008-01-02'
[解决办法]
TO_CHAR(today,'%D') 08/10/09
TO_CHAR(today,'%y-%m-%d') 09-08-10
TO_CHAR(today,'%Y-%m-%d') 2009-08-10
TO_CHAR(today,'%A %B %d %Y') Monday August 10 2009
[解决办法]
where date(inputtime) between '2008/01/01' and '2008/01/02'