# Query timerange from a influxdb tag and use it as variable for a second query

**URL:** <https://community.influxdata.com/t/query-timerange-from-a-influxdb-tag-and-use-it-as-variable-for-a-second-query/30131>\
**Category:** InfluxDB 2\
**Tags:** grafana, query\
**Created:** [May 30, 2023, 8:26am UTC](https://community.influxdata.com/t/query-timerange-from-a-influxdb-tag-and-use-it-as-variable-for-a-second-query/30131 "2023-05-30T08:26:15Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![fercasjr](https://avatars.discourse-cdn.com/v4/letter/f/e495f1/32.png) [@fercasjr](https://community.influxdata.com/u/fercasjr)\
**Post date:** [May 30, 2023, 1:43pm UTC](https://community.influxdata.com/t/query-timerange-from-a-influxdb-tag-and-use-it-as-variable-for-a-second-query/30131/2 "2023-05-30T13:43:12Z")

</div>

hint:

[Referencing “\_time” from previous query as “range(start: , stop:now())” for a following query. I can’t get it to work - InfluxDB 2 - InfluxData Community Forums](https://community.influxdata.com/t/referencing-time-from-previous-query-as-range-start-stop-now-for-a-following-query-i-cant-get-it-to-work/29280/15)

If I have some free time I will return with the solution, I have done what you are asking multiple times…

---

_[View the full topic](https://community.influxdata.com/t/query-timerange-from-a-influxdb-tag-and-use-it-as-variable-for-a-second-query/30131)._
