J
|
Jane 8/20/2007 |
Stephan, select greens, gir, (gir/greens)*100 as Percentage from TableName |
M
|
mmponline author 8/20/2007 |
Thanks Jane, this work just fine. 1 Question however: |
M
|
mmponline author 8/22/2007 |
Any idea on how to ignore the 0/0 in the average calculation? |
J
|
Jane 8/22/2007 |
Stephan, function BeforeProcessList(&$conn) { global $summa,$cc; $sum = 0; $cc = 0; } function BeforeProcessRowList(&$data) { global $summa,$cc; $sum += $data["FieldName"]; if ($data["FieldName"]) $cc++; return true; } function BeforeShowList(&$smarty,&$templatefile) { global $sum,$cc; $smarty->assign("showtotal_UnitsInStock",$sum/$cc); } |
|
hfg 9/7/2007 |
Is there a way to apply this same concept to a Report? |