I'm sure there is something better than what I'm doing, basically I want to
do a weekly count of how many people have signed up for our newsletter.
Here's what I have, it seems VERY inefficient. Any SQL gurus out there wanna
help me out? Thanks in advance.
<cfset end="5/19/01">
<cfloop condition="#end# LT now()">
<cfquery name="stats" datasource="email" dbtype="OLEDB"
cachedwithin="#CreateTimeSpan(30, 0, 0, 0)#">
SELECT count(id) as num
FROM MAIN
WHERE date between '#dateformat(DateAdd("d", -7, end))#' AND
'#dateformat(end, "mm/dd/yy")#'
</cfquery>
<cfoutput query="STATS">
<td align="center" valign="bottom">[formatting clipped for
clarity]</td>
</cfoutput>
<cfset end="#DateAdd("d", +7, end)#">
</cfloop>
John Venable
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
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