at the moment they are ordered like below.
33 1/2008
30 10/2007
28 11/2007
22 12/2007
30 2/2008
35 3/2008
35 4/2008
23 5/2008
27 6/2008
31 8/2007
38 9/2007
Code: Select all
$conn=odbc_connect('DB','user','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
$array = array('10/2007', '11/2007', '12/2007', '1/2008', '2/2008', '3/2008', '4/2008', '5/2008', '6/2008', '7/2008', '8/2008', '9/2008');
print_r($array);
$sql="SELECT Count([ECNs by month].ECN_Number) AS CountOfECN_Number, [ECNs by month].thedate
FROM [ECNs by month]
GROUP BY [ECNs by month].thedate, [ECNs by month].Location
HAVING ((([ECNs by month].Location)='ASCO Joucomatic Ltd.'))
ORDER BY [ECNs by month].thedate";
$rs=odbc_exec($conn,$sql);
if (!$rs)
{exit("Error in SQL");}
echo "<table><tr>";
echo "<th>ECN Number Count</th>";
echo "<th>Date</th>";
while (odbc_fetch_row($rs))
{
$compname=odbc_result($rs,"CountOfECN_Number");
$conname=odbc_result($rs,"thedate");
echo "<tr><td>$compname</td>";
echo "<td>$conname</td>";
}
odbc_close($conn);
echo "</table>";