I want to create a report that shows month totals and year to date
totals together but do not know how to go about it. This is what I
have so far to get the month totals:
$date = '20041101000000';
$date1 = '20041201000000';
$result = mysql_query("select a1.part Part, sum(a1.quantity)
Totalordered from a1 where a1.datesold > $date and a1.datesold < $date1
group by a1.part");
echo "<table>";
while ($row = mysql_fetch_row($result)) {
echo "<tr>";
for ($i=0; $i<mysql_num_fields($result); $i++) {
echo "<td>";
echo "<font face='arial,helvetica' font
size='1'>$row[$i]</font>";
echo "</td>";
}
echo "</tr>\n";
}
echo "</table>";
This displays the month totals fine but I want to add a column next to
the month and call it YTD with a different date range. Any ideas?