I had this working fine one morning and checked it on all computers.
I come in another morning and it's not working - I swear. It's
giving me the error, "invalid number" and lists the WHERE in the
query as the line culprit. I have the same query where I added the
line to there WHERE:
marathon_id = #cookie.vancouver_walk# AND
and this seems to work fine, but I don't want to specify an ID,
instead querying for everyone, so this query doesn't have it.
<cfset first_day = createDate(URL.yr,URL.mo,URL.day)>
<cfset last_day = dateAdd("d",6,first_day)>
<cfset the_num_days = 0>
<cfset the_num_steps = 0>
<cfloop index="zz" from="1" to="#the_week#">
<!-- return values for the week -->
<CFQUERY NAME="get_gweek_totals" DATASOURCE="dpch">
SELECT Sum(entry) AS num_steps,Count(entry) AS num_days
FROM marathon_entries
WHERE entry_type = 'vancouver_walk' AND
entry_data_date >= #first_day# AND entry_data_date <= #last_day#
</CFQuery>
<cfset first_day = dateAdd("d",7,first_day)>
<cfset last_day = dateAdd("d",6,first_day)>
<cfset header="Week #zz#">
<tr>
<td>#header#</td>
<td width="20%"
align="right">#NumberFormat(get_gweek_totals.num_steps,',')#</td>
<cfset g_av_steps = 0>
<cfif get_gweek_totals.num_days NEQ 0 >
<cfset g_av_steps =
Int((get_gweek_totals.num_steps/get_gweek_totals.num_days))>
</cfif>
<td width="20%" align="right">#NumberFormat(g_av_steps,',')#</td>
<cfif get_gweek_totals.num_steps EQ ""><cfset
get_gweek_totals.num_steps = 0></cfif>
<td width="20%"
align="right">#NumberFormat((get_gweek_totals.num_steps *
2.25)/5280,'___._')#</td>
</tr>
<cfset the_num_days = the_num_days + get_gweek_totals.num_days>
<cfif get_gweek_totals.num_steps EQ ""><cfset
get_gweek_totals.num_steps = 0></cfif>
<cfset the_num_steps = the_num_steps + get_gweek_totals.num_steps>
</cfloop>
--
Daniel Kessler
Department of Public and Community Health
University of Maryland
Suite 2387 Valley Drive
College Park, MD 20742-2611
301-405-2545 Phone
www.phi.umd.edu
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Special thanks to the CF Community Suite Gold Sponsor - CFHosting.net
http://www.cfhosting.net
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:185572
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54