一个关于datediff()的问题

飞起来一脚 2003-12-04 10:38:41
为了提取论坛中在10天内回复(nreply)数量最多的一个帖子,sql语句如下:
sql="select top 1 id,name,title,date,father,nreply,nclick from forum where father='0' and "&datediff(d,date,now())&"<10 and top=false order by nreply desc"


但是显示出错了,错误就是在datediff()<10部分,请问那里错误了
其中date的表示的是forum表中储存发贴时间的列名
...全文
51 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
qunluo 2003-12-05
  • 打赏
  • 举报
回复
主要是不清楚你的数据库安排!
要不然可以想想其它方法!
monkeys 2003-12-05
  • 打赏
  • 举报
回复
不好意思,弄错了那个函数,该da

sql="select top 1 id,name,title,date,father,nreply,nclick from forum where father='0' and datediff("d",date,now())<10 and top=false order by nreply desc"
飞起来一脚 2003-12-04
  • 打赏
  • 举报
回复
真的不支持?
monkeys 2003-12-04
  • 打赏
  • 举报
回复
access好像不支持datediff
a_zhe_20 2003-12-04
  • 打赏
  • 举报
回复
sql="select top 1 id,name,title,date,father,nreply,nclick from forum where father='0' and datediff("d",date,now())<10 and top=false order by nreply desc"
飞起来一脚 2003-12-04
  • 打赏
  • 举报
回复
我用的是access数据库,win2000 professional ,iis5.0
飞起来一脚 2003-12-04
  • 打赏
  • 举报
回复
还是不行
cshadow 2003-12-04
  • 打赏
  • 举报
回复
sql="select top 1 id,name,title,date,father,nreply,nclick from forum where father='0' and datediff(d,date,now())<10 and top=false order by nreply desc"

28,407

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧