P
erformance to
P
lan
R
eport
write(WriteCustomSelections())
Customer Name
Current YTD
Planned YTD
% to Plan
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("
" + cursor.custname + "
"); write("
$" + NRound(cursor.SumCurrentSales,0) + "
"); write("
$" + NRound(cursor.SumPlanSales,0) + "
"); write("
" + NRound(cursor.inc,2) + "%
"); write("
"); } cursor.close();