Re: bar chart - how to sort and order correctly date by day?
Reply #2 –
Hi willvin, your query display the same results. After some other researches I found another way (subquery) to display the correct data. Here is my updated query for anyone having my problem:
SELECT *
FROM (
SELECT
COUNT(privacy_reg) AS registrati,
DATE_FORMAT(data_registrazione_reg, '%Y/%m/%d') AS datareg,
DATE_FORMAT(data_registrazione_reg, '%d/%m/%Y') AS datavis
FROM
registrazioni
GROUP BY
datareg
ORDER BY
datareg DESC
LIMIT 15
) as reg
ORDER BY
datareg ASC
I use the datavis column for my chart.
HTH
Tony