How to get the time range selected on the dashboard into a variable

As yosiasz properly pointed out, you can use “Global variables”.

MS SQL code:

SELECT [DateTime]
      ,[AirTemp]
  FROM [meteoData]
  WHERE [DateTime] BETWEEN '${__from:date:iso}' AND '${__to:date:iso}'
  ORDER BY [DateTime] DESC;
5 Likes