求最近七天的数据? select * from table where date =dateadd(dd,-7,getdate()) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select * from tablename where 日期 between (SELECT DATEADD(day, -7, getdate())) and (getdate()) order by 日期 desc select * from table where date > dateadd(dd,-8,getdate()) select * from table where 时间=dateadd(day,-7,时间) select * from tablename where datediff(day,日期,getdate())<7 不好意思 应该是 select * from table where 时间>=dateadd(day,-7,时间) select * from tablename where convert(char(10),時間,120)>convert(char(10),dateadd(dd,-7,時間),120) 呵呵,数据库最近七天的数据不能用 getdate()函数,数据库最新的时间不是当天的时间啊。 新手问个好菜的问题 SQL触发器问题 各位高手帮我写个存储过程,关于指定相关参数,从某个表中取出top n 条记录的存储过程 想了半天没想出来,向大家学习! SQl Server的学习? 奇难,,,一个关于存储过程的问题 大家来看看,我这样设计能不能实现? 提高查询速度方法总结 如何通过代码设置SQL SERVER客户端 程序中传递密码给数据库文件 在数据库怎么递归目录的插入呢操作 請問sql語句 insert table1 values(N'測試' ) ,N後的常量換成變量應怎樣寫?
where convert(char(10),時間,120)>convert(char(10),dateadd(dd,-7,時間),120)