查询时,我想将选择出距离今天30天内的记录值,我的字段是datetime型的,我使用了如下语句
sql="select * from datebase000 where noo=1 and datediff('d',enddate,date)<30 order by ID desc"
但出错了,请各位朋友帮忙指正,听说
datediff只能用在access数据库,在sql中使用不起来,请各位帮我看看这语句应该怎么写.
...全文
4681打赏收藏
在sql server关于将日期加减问题
查询时,我想将选择出距离今天30天内的记录值,我的字段是datetime型的,我使用了如下语句 sql="select * from datebase000 where noo=1 and datediff('d',enddate,date)<30 order by ID desc" 但出错了,请各位朋友帮忙指正,听说 datediff只能用在access数据库,在sql中使用不起来,请各位帮我看看这语句应该怎么写.