|
SELECT top 100 PE_CommonModel.*,PE_U_zhiban.* FROM
PE_CommonModel INNER JOIN PE_U_zhiban ON PE_CommonModel.ItemID = PE_U_zhiban.ID
where PE_CommonModel.Status = 99
and datediff(day,PE_CommonModel.UpdateTime,CONVERT(varchar, getdate(),120))<7
and datediff(day,PE_CommonModel.UpdateTime,CONVERT(varchar, getdate(),120))>=0
order by PE_CommonModel.UpdateTime desc
【1】
CONVERT(varchar, getdate(),120)
获系统当前的时间
【2】当前的时间减去 文章更新的时间 如果0<值<7 就显示文章
本文由胡金金个人网站整理发布,转载请注明地址:http://www.hujinjin.com/info/171.html