I have a query that selects a few fields then date_formats one of these fields and orders the output by the formatted date: $query2=mysql_query("SELECT reqrmnt,DATE_FORMAT(datedue,'%m-%d-%Y')AS datedue,DATE_FORMAT(datecompleted,'%m-%d-%Y')AS datecompleted,DATE_FORMAT(expires,'%m-%d-%Y')AS expires FROM $usertable WHERE ID='$id' ORDER BY datedue ASC")or die ("Error: ".mysql_error());
The problem is that the order by only uses the m(or month) to order it by when I need to have it ordered by the whole date, m-d-Y. What do I need to do so it recognizes all of the date not just the month.
Thanks for your help.