Hi, I have an events database that has two datetime field types for example:
2001-03-22 01:01:00
One for the beginning of each event and one for the ending of each event.
I want to create a query that returns all events whos ending date has not yet past and order them from the most recent beginning date to the most future beginning date.
I have the following query so far
$query = "SELECT DATE_FORMAT(startdate, '%M %D, %Y %l:%i %p') AS for_startdate,DATE_FORMAT(enddate, '%M %D, %Y %l:%i %p') AS for_enddate,event,description,cost,url FROM tablename WHERE "something here to restrict to ending dates >= today" ORDER BY "something here to sort by beginning date with most recent ones first";
I think this might be easier if I was not using DATE_FORMAT in the query but is it possible to get the result I want and still use it? Appreciate any help! Thanks.