here's some code to do what you need. if the first week starts before
the
1st of january, the start date will be in december of the previous
year.
likewise, if week 52/53 extend into the following year, the end date
will be
in that year's january.
<!--- calculate start/end date for year+week --->
<cfparam name="intWeek">
<cfparam name="intYear"><cfset dtmWeekStar=
DateAdd("d",(DayOfWeek("1/1/#intYear#")*-1)+1,
DateAdd("ww",intWeek-1,"1/1/#intYear#"))>
<cfset dtmWeekEnd=DateAdd("d",6,dtmWeekStart)>
<!--- display result --->
<cfoutput>
Week Number #intWeek#<br>
Week Start Date #DateFormat(dtmWeekStart,"mm/dd/yyyy")#<br>
Week End Date #DateFormat(dtmWeekEnd,"mm/dd/yyyy")#<br>
</cfoutput>
brendan avery 2.0 - [EMAIL PROTECTED]
310.779.2211 - santa monica, california
> -----Original Message-----
> From: Jeff Green [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 16:18
> To: CF-Talk
> Subject: Week Number = date range ?
>
>
> Hi all,
>
> Anyone out there have some logic to figure out what date
> range a particular
> week number is?
>
> Example:
> Week #39 in 2001 = sep/16 - sep/22
>
> I thought I this working, but it blew up around week 52 and 53 :(
>
> I query for aggregate stats by the week, so the query returns
> week number
> and year.
>
> Thanks,
> Jeff
>
>
______________________________________________________________________
Dedicated Windows 2000 Server
PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists