我用了VBScript中的Dateadd()函数,将其返回值和oracle的一个Date型的字段time进行比较,这两种日期格式不一样,如何在sql语句中进行比较?
---------------------------------------------------------------
sql="select a.ico_publishtime " & _
"from eip_content a " & _
"where a.ico_publishtime>to_date('2001-05-21','yyyy-mm-dd')""
ORACLE里面的日期字段要比较,必须将传递进去的数据进行转换才可以。
---------------------------------------------------------------
使用to_date()
to_date('2001-05-21','yyyy-mm-dd')
---------------------------------------------------------------
select * from table where dat>to_date('" & defdate & "','yyyy-mm-dd hh24:mi:ss')