日期:2014-05-16  浏览次数:20830 次

asp的sql语句时间怎么写?
sql="select * from songhuo where (songhuotime-#now()#)>1"

这么写不对,请问应该怎么写啊    意思就是数据库里songhuotime跟当前时间比在1天(24小时)之外的

另外问一下,如果是10小时之外的   怎么写?
------解决方案--------------------
ACCESS:
sql= "select * from songhuo where DATEDIFF('d', now(), songhuotime)>1"
sql= "select * from songhuo where DATEDIFF('h', now(), songhuotime)>10"
SQL Server:
sql= "select * from songhuo where DATEDIFF(d, GETDATE(), songhuotime)>1"
sql= "select * from songhuo where DATEDIFF(hh, GETDATE(), songhuotime)>10"