想法:想显示“每周工作”、“其它工作”、“校务公开”、“教师园地”这几个栏目当天添加的文章数目统计,起到一目了然的作用。
实现:
SQL语句为 select count(*) as TodayCreate from [PE_Article] where classid in (127,128,129,130) and status=3 and Deleted=0 and datediff(day,createtime,getdate())=0
标签内容为 {Loop}{Infobegin}(今日更新 <FONT color=red>{$Field(0,Num,0,0)}</FONT> 条){Infoend}{/Loop}
解释:
127~130为四个栏目的ID,datediff(day,createtime,getdate())=0是createtime与当天日期(getdate()获取得到)之差为0