Performance to Plan Report write(WriteCustomSelections()) cursor = database.cursor( "Select Custname, "+ " SUM(CurrentSales) SumCurrentSales, "+ " SUM(PlanSales) SumPlansales, "+ " SUM(CurrentSales) / SUM(PlanSales) * 100 inc "+ "from SalesInformation s, customer c, Product p "+ "where c.custid = s.custid "+ "and s.ProdID = P.ProdID "+ BuildQuery(client.CustID, client.ProdID, client.CustGroupID, client.ProdGroupID)+ "group by c.custname "+ "order by inc desc"); while( cursor.next() ) { write(""); write(" "); write(" "); write(" "); write(" "); write(""); } cursor.close();
Customer Name Current YTD Planned YTD % to Plan
" + cursor.custname + "$" + NRound(cursor.SumCurrentSales,0) + "$" + NRound(cursor.SumPlanSales,0) + "" + NRound(cursor.inc,2) + "%