OK, think about it. When using OR, if DayofWeek(datefield) is actually 7, and
it hits the first test of DayofWeek(datefield) is not 1, then the CFIF would be
TRUE and it would never perform the second test to see if DayofWeek(datefield)
is not 7. Using the NOT [i]requires[/i] that you use AND.Phil
DJ5MD - 28 Jul 2006 18:21 GMT
:grin;
Gotcha Phil, I misunderstood.
Anyway, here is the code that worked for my loop:
<!--- Looping queries to get range of dates and filtering out Weekend dates
--->
<cfloop from="#GetStartDate.StartDate#" to="#GetEndDate.EndDate#" index="i">
[b][i]<cfif (dayOfWeek(i) gt 1) AND (dayOfWeek(i) lt 7)>[/i][/b]
<cfset variables.keyvalue = DateFormat(i, "YYYY/MM/DD")>
<cfset structDaysTemplate["#variables.keyvalue#"] = "">
<cfset structRooms.Days["#variables.keyvalue#"] = "#DateFormat(i, "MM/DD")#">
<cfset structRooms.Totals["#variables.keyvalue#"] = 0>
</cfif>
</cfloop>