:rolleyes: I am trying to develope a simple application that will record a teams miles per week and total miles I have the code working to accumulate the total, but the problem is how to I get it to accumulate just for the one team and not for all? How do I get it to accumulate for just one team Name? Code is as follows:
Code:
<CFQUERY NAME="Mileage" DATASOURCE="#dsn#">SELECT weeklyMileage, totalMileageFROM mileage</CFQUERY>cfset totalMileage= 0> <cfloop query="Mileage"><cfset totalMileage =totalMileage + Mileage.weeklyMileage></cfloop> <cfquery datasource="#dsn#" dbtype="ODBC"> Insert Into mileage (dateupdated,teamName,teamLeader,email,weeklyMileage,mileageWeekNumber,comments,totalMileage) Values ('#Trim(thetime)#','#Trim(teamName)#','#Trim(teamLeader)#','#Trim(email)#','#Trim(weeklyMileage)#','#Trim(mileageWeekNumber)#','#Trim(comments)#','#Trim(totalMileage)#')</cfquery>