Hello,
I save my gas meter "gasmeter" readings together with time and date "time" to my MariaDB "gas".
With the following query code:
Select
EXTRACT(DAY FROM time),
MAX(gasmeter)-MIN(gasmeter) AS "gasmeter"
From gas
WHERE
MONTH(time) = {{payload}}
Group By CAST(time AS DATE);
in a template node I'm able to retrieve my data as daily consumption in mm² for one month and use it on my dashboard. "{{payload}}" comes from a dropdown node (1 through 12) for each month.
Is there a way to change the "MONTH(time) = {{payload}}" condition into a "YEAR_MONTH" condition, so I can use my saved data for longer than 12 months?
Thank you in advance.