Hi all,
I'm trying to create a report of order information, grouping by date DESCENDING - newest dates first, oldest last. But no matter what I do, it always renders oldest first.
MySQL syntax is:
SELECT fields
FROM table
GROUP BY field {ASC/DESC}
But no matter whether I modify the report SQL directly to include ASC or DESC, nothing changes.
The date field is an INT field storing the unix timestamp, so the specific query I've got is:
SELECT
id,
order_ref,
client_id,
client_firstname,
client_lastname,
client_email,
FROM_UNIXTIME(order_date) AS order_date,
order_status,
ship_date
FROM orders
GROUP BY FROM_UNIXTIME(order_date) DESC, order_ref
Can anyone provide any help?
Regards,
Andy