let it be
行到水穷处 坐看云起时

本周:select * from table where datediff(week,C_CALLTIME,getdate())=0     --C_CALLTIME 为日期字段
本月:select * from table where datediff(Month,C_CALLTIME,getdate())=0   --C_CALLTIME 为日期字段
本季:select * from table where datediff(qq,C_CALLTIME,getdate())=0
前半年1-6,后半年7-12:select * from table where datepart(mm,C_CALLTIME)/7 = datepart(mm,getdate())/7

本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/eyu777/archive/2009/06/18/4280303.aspx

posted on 2009-07-04 17:21  流浪浪  阅读(732)  评论(0编辑  收藏  举报