I want to select all data from last month depends on actually date.
Example: today 2018-06-21 -> I need all datas from 2018-05-01 - 2018-05-31
with
SELECT * FROM “” WHERE time >= 1525125600000000000 and time <= 1527803999000000000
I will get it. But the Timerange should variable (depends on “today”)
somthing like this:
SELECT * FROM “” WHERE time = month(today)-1
the last 30 days I will get with time < now() - 30d
How is this accomplished using Flux? The closest I could get is using this, but that still does the last 30 days, not the current month. |> range(start:-30d, stop:now())
Thanks for your help!
Hi Marc, Thanks for the quick reply. I’m new to InfluxDB but I’m loving all the things I’m finding it capable of doing.
After your reply, I read through the entire link that you mentioned and there was a lot of good things there. My goal is to have dynamically updated ranges, so I’ve decided to not go with absolute time ranges like you recommended. I did come across some people using window() to get what I’m looking for.
|> window(every: 1mo, period: 1mo)
I don’t quite have enough data yet to tell if it’s working, but I’ll keep an eye on it and continue to play with it. Thanks again!