如题。
如table中记录如下:
code name size type flag crt_date
001 书 大 A Y 2007-4-10
002 笔 中 B Y 2007-4-10
003 电脑 中 C Y 2007-4-10
如这三条记录中如果在10天后,即2007-4-20后 没做任何更新,则将字段flag的值改为N
如何实现,谢谢
------解决方案--------------------
select * ,
[flag]=case when convert(varchar(10),crt_date,120) between convert(varchar(10),getdate(),120) and convert(varchar(10),getdate(),120) then 'N ' else 'Y ' end
from 表名