Hi there!
I am trying to access some records from a MS Access DB. I am trying to get a list (in a table) of donors in the last 5 days. Here is the code
$sql = "SELECT Donors.DonorID, [Donors].LastName, [Donors Sub].Date, [Donors Sub].Amount
FROM Donors INNER JOIN [Donors Sub] ON Donors.DonorID = [Donors Sub].DonorID
WHERE [Donors Sub].Date Between Date() And Date()-5
ORDER BY [Donors Sub].Date DESC";
$rs = $conn->Execute($sql);
?>
<table border="1" bordercolor="#003366">
<tr bordercolor="#003366" >
<th width="100" bordercolor="#00FFCC">Last Name</th>
<th width="100" bordercolor="#00FFCC">Date</th>
<th width="100" bordercolor="#00FFCC">Amount</th>
</tr>
<?php while (!$rs->EOF): ?>
<tr>
<td align="left"><?= $rs->Fields['LastName']->Value ?></td>
<td align="center"><?= $rs->Fields['Date']->Value ?></td>
<td align="right"><?= $rs->Fields['Amount']->Value ?></td>
</tr>
<?php $rs->MoveNext() ?>
<?php endwhile ?>
</table>
<?php
$rs->Close();
$conn->Close();
And my output is:
Last Name Date Amount
Jones 1085112000 50
My date is showing as a string, not formated. How can I format the output? I've tried
<?= date("F d, Y", strtotime($rs->Fields['Date']->Value)) ?>
and I get
Warning: date(): Windows does not support dates prior to midnight (00:00:00), January 1, 1970 in c:\inetpub\wwwroot\north.php on line 26
Any suggestions?