| 发表于:2007-04-16 16:07:311楼 得分:0 |
在检索的时候 做个判断 case when datediff(day,日期字段,getdate())=0 then '今天 ' when datediff(day,日期字段,getdate())> 0 and datediff(day,日期字段,getdate()) <=7 then '本周 ' when datediff(day,日期字段,getdate())> 7 and datediff(day,日期字段,getdate()) <=14 then '上周 ' when datediff(month,日期字段,getdate())=1 then '上月 ' ... end as 分类 | | |
|