Ask Ben: Getting the Previous Day In ColdFusion, Excluding Saturday And Sunday

<!---
	Get the current DATE. Fix()'ing the date will chop
	off the time portion of the date/time stamp.
	Caution: This will result in a NUMERIC date, not
	a standard date.
--->
<cfset dtNow = Fix( Now() ) />
 
<!---
	Now, let's loop over the past 10 WEEKDAYS. This is
	different from days. Weekday math does not include
	weekends in its calculations.
--->
<cfloop
	index="intOffset"
	from="0"
	to="10"
	step="1">
 
	<!--- Get the WEEKDAY that we want to show. --->
	<cfset dtDay = DateAdd( "w", -intOffset, dtNow ) />
 
	<!---
		Output the full date so we can see BOTH the day
		of the week and the day-date.
	--->
	#DateFormat( dtDay, "full" )#<br />
 
</cfloop>

For Cut-and-Paste