Query Max / Min Value in InfluxDB between now and the start of day


I’m recording the temperature of my house in the Influx DB database and I would like to know, during the day, the MAX and MIN value between the start of day until now ( and now to use now - 1day).
But the time operator “start of day” doesn’t exist in InfluxDB, but I can see this value on grafana, and I tell me that is possible to do that but why .
Could you help me please ?

Thank you !

Anyone can help me ?

How are you defining start of day? Do you mean since 12:00:00 or now() - 1d ?

In flux you can simply add the function |> min() to your query to get the min, and likewise the call to |> max() to get the max for the same window.

in InfluxQL SELECT max("temp_c") AS "max_temp_c" FROM "telegraf"."autogen"."environment" WHERE time > :dashboardTime: GROUP BY time(:interval:)

Should do it (you’ll have to adjust for your measurements and fields, of course.


In fact, I would like to get the max and min value, in InfluxDB base (temperature), since the start of day, which means, since for today in example 2019/11/21 at 00:00:00 until now.

Thank you for your help