Easiest way to produce variables for things such as current day of week, month, year, etc?

Is there a simpler way to get these values into other queries through variables?

For example, if using MySQL as the Datasource, I can do SELECT MONTH(NOW()) and have a $CurrentMonth variable to feed into other queries so they auto-update as time passes.

I noticed there’s a -- Grafana -- datasource, so I thought that perhaps I could do something similar there so I’m not passing the work to my MySQL database.

I believe I’ve found that passing time range selections into variables isn’t possible.

What is the best way to do this?

Not rigtht now. Unless you can query for them and use them in variables

1 Like