sql问题datediff.....这个问题老是解决不了..郁闷,帮帮忙
数据库是 ACCESS 的
intime 日期型 默认 now()
表 aa
字段 id title intime
1 aa 2001-12-23 11:34:12
2 bb 2002-12-23 11:34:12
3 cc 2003-12-23 11:34:12
... ... 2004-12-23 11:34:12
为什么我用以下SQL语句都是错的
.......
set rs=server.CreateObject("adodb.recordset")
sql="select * from aa where datediff(yy,intime,getdate())>1" 或
sql="select * from aa where datediff(yy,intime,"&getdate()&")>1" 或
sql="select * from aa where datediff(yy,intime,'"&getdate()&"')>1" 或
rs.Open sql,conn,1,1
把 yy换成'yy', intime换成'intime' getdate() 换成 now(),date()
都试过.都不行..
老是提示 Microsoft OLE DB Provider for ODBC Drivers (0x80040E21) 错误...
郁闷了.