我想在本周找到记录,只需声明当前日期即可。例子:
select datename(dw,getdate()) -- Example today is Friday "27-04-2012"
所以我怎样才能得到日期范围
start on monday "23-04-2012" or sunday "22-04-2012" As @dateStart to
end on sunday "29-04-2012" or saturday "28-04-2012" As @dateEnd
然后我可以选择查询
select * from table where date>=@dateStart AND date<=@dateEnd