I retrieve a bunch of dynamic DateFroms and DateTos that a user has input into 
a form.    
<!--- Loop through the dateField IDs to get the Dates ranges---> 
<cfloop list="#form.DatefieldID#" index="id">           
<!--- Get the dates---> 
<cfset DateFrom = form["dateFrom_" & id]> 
<cfset DateTo = form["dateTo_" & id]> 
<!--- Format the dates---> 
<CFSET DateFrom1 = #DateFormat(DateFrom, "yyyy-mm-dd")#> 
<CFSET DateTo1 = #DateFormat(DateTo, "yyyy-mm-dd")#> 
<!--- Get the number of days in each period---> 
<cfset DateDifference = DateDiff("d", "#DateFrom1#", "#DateTo1#")+1> 
</cfloop> 
 I want to know the DateFrom of the first period that is more than 4 days and I 
want to find out if each date range is separated by at least one day. I have 
ensured that the date ranges are in chronological order and the DateFrom is 
before the DateTo.
<!--- Get the DateFrom of the first period that is more than 4 days?---> 
<cfif #DateDifference# GT 4> 
</cfif>
Any clues would be much appreciated! 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Get the answers you are looking for on the ColdFusion Labs
Forum direct from active programmers and developers.
http://www.adobe.com/cfusion/webforums/forum/categories.cfm?forumid-72&catid=648

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:291821
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to