SQL Graph Error

Hi Forest,

I’m trying to create time-based SQL queries following the documentation right here:

I’m using the syntax from the docs but I’m still getting this error and can’t display the chart. What’s the issue here?


The project name is “Monta Admin Panel”.

Thank you in advance!

hi @Arda_Yurdakul,

Sorry this is not mentionned but this SQL snippet is for PostgreSQL database.

You can either:

  • fix the SQL to make it compatible on MySQL
  • or use the SIMPLE option that allow you to perform the same feature:

Hi @Sliman_Medini,

I see. Just using simple is not option unfortunately because most of our time based graphs will be in an hourly timeframe which is not available in the simple option. Is there a doc for making it MySQL compatible?

This should do the job:

SELECT
  DATE_FORMAT(`comment`.`Datetime`, '%Y-%m-01 00:00:00') AS `key`,
  count(`comment`.`ID`) AS value
FROM `comment` 
GROUP BY 1 
ORDER BY 1;

:gift:

Ok, do not hesitate to ask for feature when you see something is missing for you.
Adding the hourly timerange to charts looks a decent feature request.
I am adding it to our product board.

Regards

1 Like

Thank you, looking forward to that feature as well! :grinning: