I am trying to include only those dates that are before a certain date. However, if the first one is before, all of the dates are included which is not correct. I will then build this on, so that only dates that are between a certain range are included. 
The code that i am using, is:
(obviously StartingDate is a variable that is being defined each time in DZEvent)
 
<dtml-with ItineraryEvents>
<dtml-in expr="objectValues('DZEvent')" sort=StartingDate>
<dtml-let divider="'2004/01/12'" start=StartingDate>
<dtml-if " divider>start">
<dtml-let start=StartingDate>
The Date is: <dtml-var StartingDate>
</dtml-let>
</dtml-if>
</dtml-let>
</dtml-in>
</dtml-with> 
 
Any help on or off list greatly appreciated,
 
Tom