Trend Report write(WriteCustomSelections()) var Rank = 1; cursor = database.cursor( "Select Year, s.Month, m.MonthName, "+ " SUM(CurrentSales) SumCurrentSales, "+ " SUM(PriorSales) SumPriorsales, "+ " (SUM(CurrentSales) / SUM(PriorSales)-1.0)*100 Inc "+ "FROM SalesInformation s, MonthReference m, Product p, Customer c "+ "WHERE m.Month = s.Month " + "AND s.CustID = c.CustID " + "AND s.ProdID = p.ProdID "+ BuildQuery(client.CustID, client.ProdID, client.CustGroupID, client.ProdGroupID)+ "GROUP by year, s.Month, MonthName " + "ORDER by year, s.Month "); while( cursor.next() ) { write(""); write(" "); write(" "); write(" "); write(" "); write(" "); write(""); } cursor.close();
Year Month Current Year Prior Year % Inc
" + cursor.year + "" + cursor.monthname + "$" + NRound(cursor.SumCurrentSales,0) + "$" + NRound(cursor.SumPriorSales,0) + "" + NRound(cursor.Inc,2) + "%