Thanks for the reply. I changed my sql statement to what I have below and it works. But what do I need to do in order display the grand total number of hours?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Retrieved Information</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h2 Employee Information</h2>
<?php
$Query = "Select ANumber,FirstName,LastName,Department,TeamLeader,DateOfService,Sum(NumberOfHours) AS Hours,ActivityType,
Org,Description,TimeTakenWhen,SiteID
FROM activitytracking WHERE DateOfService BETWEEN '%".$POST[txtStartDate]."%'
AND '%".$POST[txtEndDate]."%' AND Department Like '%".$POST[Departments]."%'
AND SiteID Like '%".$POST[Sites]."%'
GROUP BY Department,TeamLeader,NumberOfHours";
$result = mysql_db_query ($DBName, $Query, $Link);
//Fetch the results frm the database
print "<b><p>These are the records for the criteria you selected.</b></p>";
print "$TeamLeader";
print "<table border=1><tr><th>Employee Number</th>";
print "<th>First Name</th><th>Last Name</th><th>Department</th><th>Team Leader</th>";
print "<th>Date Of Service</th><th>Hours</th><th>Activity</th><th>ORG</th><th>Comments</th>";
print "<th>Involved When</th><th>SITE</th></tr>";
while ($Row = mysql_fetch_row ($result)) {
print " <tr>";
print "<td align=Center> $Row[0]</td>
<td align=Center>$Row[1]</td>
<td align=Center>$Row[2]</td>
<td align=Center> $Row[3]</td>
<td align=Center> $Row[4]</td>
<td align=Center> $Row[5]</td>
<td align=Center> $Row[6]</td>
<td> $Row[7]</td>
<td> $Row[8]</td>
<td> $Row[9]</td>
<td align=Center> $Row[10]</td>
<td> $Row[11]</td>";
print "</tr>";
}
mysql_close ($Link);
print "</table>";
?>
</body>
</html>