CFIF and date problems
First, I know this should go under General Discusion, but the new system won't let me post there. I think there are bugs with the new forum pages.
Anyway.... Here's the problem.
I have a table storing starting dates and ending dates for promotional flyers. The table also lists the flyer PDF filename so a lick can be made for it in the output. My problem is that no matter how I put the logic in the CFIF I get either all or none of the flyers to list on the ouput. My desire is to have a flyer only show during its promotional dates. Here's what I've got so far. This seems like it should be easy, but I've been staring at it too long. Thanks for any suggestions you may have.
<cfquery name="GetFlyers" datasource="sales">
select * from flyers
order by startdate
</cfquery>
<table>
<cfif #dateformat(GetFlyers.endDate,"m/d/yy")# GTE #NOW()# and #dateformat(GetFlyers.startDate,"m/d/yy")# LTE #NOW()#>
<cfoutput>
<tr><td><h4>#dateformat(GetFlyers.startDate,"m/d/yy")# thru #dateformat(GetFlyers.endDate,"m/d/yy")#</h4></td></tr>
</cfoutput>
</cfif>
</table>
