correct but the WEEK function brings back the week number for the YEAR not the MONTH.

>The key is to figure out for each date what the week number is. Once you can
>do that reliably it'll be easy. I take it that each weeks starts on a
>Sunday, so that for September 2004 we're in week 2, and week 3 starts this
>coming Sunday, right?
>
>
>
>  _____  
>
>From: Kelly Matthews [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, 8 September 2004 9:23 a.m.
>To: CF-Talk
>Subject: Help with Date Stuff
>
>
>
>Ok I have a weekly report I have to run.  Basically it's run every Sunday
>and brings back info for the previous week. If it's, as an example, the 3rd
>sunday of hte month it will bring back info for the last 3 weeks of the
>month (basically going back to the first). I have the report running fine
>however he wants me to have the display broken out to say Week 1, Week 2,
>Week 3, within the report and I cant figure out how to do that.
>
>Here is the code and where you see <!--WEEK 1 HERE--> is where that would
>need to display.
>
><CFPARAM name="enddate" default="08/17/04">
><CFPARAM name="startdate"
>default="#dateformat(Createdate(year,month,1),'mm/dd/yy')#">
><CFPARAM name="type" default="1">
><CFPARAM name="displaydate" default="">
>
><CFMAIL type="HTML" to="" server="" from="" subject="Report for #startdate#
>- #enddate#">
>
><font face="arial" size="2">
>
><CFLOOP from="#type#" to="3" step="1" index="count">
><table cellpadding="5" cellspacing="0" border bordercolor="silver"
>width="600">
>
><CFQUERY datasource="emailertemp" name="test">
>exec sp_emailreports '#startdate#','#enddate#','OSI',#count#
></CFQUERY>
><tr>
><td colspan="5">OSI <CFIF type EQ 1>Single Step<CFELSEIF type eq 2>Two Step
>Phase 1<CFELSEIF type eq 3>Two Step Phase 2</CFIF></td>
><tr>
><td><font size="2">Name</font></td>
><td><font size="2">ID</font></td>
><td><font size="2">Status</font></td>
><td><font size="2">Type</font></td>
><td><font size="2">Date</font></td>
></tr>
><tr><td colspan="5">
><!---Week 1 here (or week 2 or week 3 etc based on the date. Obviously since
>it's outside the query loop its not working right if i put it in the query
>loop it gets repeate etc.--->
></td></tr>
><CFIF Isdefined("test.recordcount")>
><CFLOOP query="test" >
><CFIF count EQ 1>
><CFSET displaydate = #dateformat(test.ssd, 'mm/dd/yy')#>
><CFELSEIF count eq 2>
><CFSET displaydate = #dateformat(test.ts1d, 'mm/dd/yy')#>
><CFELSE>
><CFSET displaydate = #dateformat(test.ts2d, 'mm/dd/yy')#>
></CFIF>
>
><tr>
><td><font size="2">#firstname# #lastname#</font></td>
><td><font size="2">#ID#</font></td>
><td><font size="2">#status#</font></td>
><td><font size="2">#description#</font></td>
><td><font size="2">#displaydate#</font></td>
></tr>
></CFLOOP>
></CFIF>
>        <CFSET type=type+1>
></table>
><P></P>
></CFLOOP>
></CFMAIL>
>
>ANy suggestions on how to do get it to group by Week 1, week 2 week 3?
>
>  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to