Order by date
Posted: Wed Mar 10, 2004 9:13 am
Hey all php newbie here. I'm trying to order a query by a date field. I've read around and it looks like the correct sql formatting is YYYY-MM-DD, however my current date format is DD.MM.YY
I've tried the following and it is not sorting correctly (I'm guessing because of the date format):
"SELECT * FROM tbl_hq_press_releases ORDER BY pr_dateAdded DESC";
What is the easiest way to format pr_dateAdded in this statement? I've been browsing the forums and a lot of people are using a DATE_FORMAT() function, but that seems to be undocumented by php.net.
Thanks for the help.
I've tried the following and it is not sorting correctly (I'm guessing because of the date format):
"SELECT * FROM tbl_hq_press_releases ORDER BY pr_dateAdded DESC";
What is the easiest way to format pr_dateAdded in this statement? I've been browsing the forums and a lot of people are using a DATE_FORMAT() function, but that seems to be undocumented by php.net.
Thanks for the help.