As a follow up, I know there is a function where I can enter a date and
retrieve the week number if falls in - Week(date) - I'm looking for one that
sort of works the other way around - something like this - WeekDates(week
number,year) This would return two variables - the starting Sunday date and
the ending Saturday date. If there isn't one like this, there should be.
:-)
Thanks!
Lawrence TMM
> Hello,
>
> Is there a function that allows me to search by the week number? What I
> mean is, there are 52 weeks in the year, is there a function where I can
> enter week number 12, and CF will search on dates that fall within that
> week of the year without me having to know what those dates are?
mxstu - 30 Aug 2005 19:55 GMT
If this is for a database search, you may want to check your database
documentation for its set of functions. For CF, you could use or adapt the
http://www.cflib.org/udf.cfm?ID=543 UDF from cflib.org.
<!---- must download "weekStartDate" UDF first --->
<cfset firstOfWeek = weekStartDate(6, 2005)>
<cfset lastOfWeek = DateAdd("d", 6, firstOfWeek)>
<cfoutput>
Start: #DateFormat(firstOfWeek, "ddd mmm dd, yyyy")# <br>
End: #DateFormat(lastOfWeek, "ddd mmm dd, yyyy")#
</cfoutput>