Rick Brandt wrote:
du****@gmail.co m wrote: Hello everyone,
There is a field of DATETIME type in our Access 2000 database. PHP is
used to query the data and display the query results on the web. Does
Access provide any function that can convert DATETIME field into a
more user friendly format directly in query? I can do the following
in MySQL. How should it be done in Access?
SELECT DATE_FORMAT('19 97-10-04 22:23:00', '%W %M %Y');
It returns 'Saturday October 1997''.
Format([DateFieldName], "dddd mmmm yyyy")
Thanks for the response. The date got formated correctly in the result
set. However the name of the field got changed.
The following PHP code snippet is used to return the name of the field:
===
/* Show fields' names in the result set*/
while( ($f = odbtp_fetch_fie ld( $qry_getdetail )) ) {
echo "<b>". $f->name ." (" . $f->type . ") , </b>";
}
===
If the query is:
$qry_getdetail = odbtp_query("SE LECT end_date FROM qryProjectDetai l");
The result is: end_date (DATETIME). And the value of 'end_date'
returned is 'Object'.
If the query is:
$qry_getdetail = odbtp_query("SE LECT FORMAT(end_date , 'mmmm d yyyy')
FROM qryProjectDetai l");
The name of the field and its type changed to be: Expr1000 (VARCHAR).
And the value of 'end_date' is correct.
Why is that? I need both the field's name and value to be correct.
Thanks,
Bing