|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
hello i got a prob.
im making an automated system for a league called a planetary. i got a database with a table named APplanets and in that table u have a colum named owner and one named tonnage. now the tonnage colum has diff numbers in it (i.e. 3000). the owner colum has diff unit names in it to specefy the owner of the planet. now what i wonna do is add up all the tons for each planet belonging to a certain unit. like this(but in cfm) name owner tonnage planetx - JF - 3000 planetx - JF - 2000 planetx - JF - 5000 planetx - JF - 4000 total tonnage 14000 get it???? |
|
#2
|
|||
|
|||
|
That should be done in the SQL statement. Use the SUM() aggregate function. The database should do as much data manipulation and number crunching as possible; that is its entire purpose.
That said, you could do this in CF by looping over the query and calculating the total. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > coding delema |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|