J
|
Jane 8/15/2007 |
Hi, select ... Sum(Cars_Sold)/Sum(Cars_Purchased)*100 as Percent, ... from TableName |
|
hfg author 8/16/2007 |
Unfortunately for my situation the average won't work. I am using sub-queries in the SQL so at times the value in the field is Null. For example: |
J
|
Jane 8/17/2007 |
Hi, global $conn; $str = "select sum(Contacted), sum(Responded) from TableName"; $rs = db_query($str,$conn); $data = db_fetch_numarray($rs); echo "Total of Contacted ".$data[0]; echo "Total of Responded ".$data[1]; echo "Total of Contacted/Total of Responded ".$data[0]/$data[1]; |
|
hfg author 8/17/2007 |
Unforntatanly I am working in reports and have sub-totals for various catagories. The solution given only show a compresensive total and does not break it down for each catagory. |
|
hfg author 8/23/2007 |
I don't know if this will help or not. |