I'm converting my ASP CLASSIC site to PHP. The site uses MS Access as database and using ODBC to connect with Databse. i'm stuck with the date formatting.
I used to Format Dates in asp as follows:
select U_ID, Trans_Code, Format(Due_Date, 'dd-mmm-yyyy') AS Due_Date
Used the same Format function in PHP but it returns error.
Warning: odbc_exec(): SQL error: [Microsoft][ODBC Microsoft Access Driver] Circular reference caused by alias 'Due_Date' in query definition's SELECT list., SQL state S1000 in SQLExecDirect in C:\wamp\www\files.php on line 28
Then i changed the alias to DDATE
the error disappears and data returns without Formatting.
I have also tried the non-sql way, but its also returns error.
Here's the date_format function i used.
echo "<td>". Date_Format($DueDate,"d.m.y") ."</td>
";
Returns this error:
Warning: date_format() expects parameter 1 to be DateTime,
Also tried this:
echo "<td>". Date_Format(DateTime($DueDate,"d.m.y")) ."</td>
";
Any help would be much appreciated . . . :)