Fog Creek Software
Discussion Board

Knowledge Base
Terry's Tips
Darren's Tips

Foreach Woes

Underneath the news with teasers for the past 3 days is this code:

{$foreach x in (and (folder "HomepageNews") (before publishdate -3) (after publishdate -20)) SortDescendBy .fileddate$}
<tr><td class="arial10pt"><a href="{$$}">{$x.headline$}</a><br>

Which should pull in headlines before 3 days ago, but after 20 days ago. But I'm only getting 2 news articles not the 8 or so that should be there. Can anyone spot the problem?

Monday, August 5, 2002

Figured it out. Had the first one as (after publishdate -3) the second had (before publishdate -3) and nothing that was published exactly on -3 days ago was getting published! So I changed one to (before publishdate -2).

Monday, August 5, 2002

*  Recent Topics

*  Fog Creek Home