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