Youre probably getting that from a query. Why not have the db calculate it for you? DRE
-----Original Message----- From: Timothy Heald [mailto:[EMAIL PROTECTED]] Sent: Friday, May 24, 2002 12:40 PM To: CF-Talk Subject: RE: Array questions Let me expand this a bit more: <CFSCRIPT> <!--- initialize the total variable to hold the sum of the array's value ---> total = 0; for(i = 1; i lt arrayLen(studentInfo[5]); i = i + 1){ total = total + studentInfo[5][i]; } average = total / arrayLen(studentInfo[5]); </CFSCRIPT> StudentInfo being what I called the array. This will do it for a 2 dimensional array. Tim Heald ACP/CCFD :) Application Development www.schoollink.net > -----Original Message----- > From: Timothy Heald [mailto:[EMAIL PROTECTED]] > Sent: Friday, May 24, 2002 2:29 PM > To: CF-Talk > Subject: RE: Array questions > > > Looks like a neat problem. Lets see: > > <CFSCRIPT> > > <!--- initialize the total variable to hold the sum of the array's > value ---> > total = 0; > > for(i = 1; i lt arrayLen(avgMark); i = i + 1){ > total = total + avgMark[i]; > } > > average = total / arrayLen(avgMark); > > </CFSCRIPT> > > That should do it right? > > Tim Heald > ACP/CCFD :) > Application Development > www.schoollink.net > > > -----Original Message----- > > From: Thane Sherrington [mailto:[EMAIL PROTECTED]] > > Sent: Friday, May 24, 2002 2:15 PM > > To: CF-Talk > > Subject: Array questions > > > > > > If I define a 2 dimensional array with info in it like this: > > > > Element Name LowMark HighMark AvgMark > > 1 Fred 22 88 45 > > 2 Bob 55 96 83 > > > > Is there a way to easily get the average of the average column > > (getting the > > lowest mark and highest should be easy with ArrayMin and ArrayMax), or > > would be better off with four single dimension arrays? > > > > T > > > > > ______________________________________________________________________ Get the mailserver that powers this list at http://www.coolfusion.com FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists