如何查询本周内的数据?
在数据库中定义过一字段datetime类型,如果在这字段中找出一周内的数据?
------解决方案----------------------try
select * from T
where datepart(wk, colName)=datepart(wk, getdate())
------解决方案--------------------select * from tb where datediff(week , getdate() , 时间字段) = 0
------解决方案--------------------Select data,date From Table_1
Where Datename(week,date)=Datename(week,Getdate())
可以获取到本周的数据