# Influxdb2 Fields displayed in a measurement in different time ranges are different

**URL:** <https://community.influxdata.com/t/influxdb2-fields-displayed-in-a-measurement-in-different-time-ranges-are-different/33552>\
**Category:** InfluxDB 2\
**Tags:** influxdb, influxql, query\
**Created:** [March 14, 2024, 10:12am UTC](https://community.influxdata.com/t/influxdb2-fields-displayed-in-a-measurement-in-different-time-ranges-are-different/33552 "2024-03-14T10:12:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![xiaopengshinidie](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/xiaopengshinidie/32/15274_2.png) [@xiaopengshinidie](https://community.influxdata.com/u/xiaopengshinidie)\
**Post date:** [March 14, 2024, 10:12am UTC](https://community.influxdata.com/t/influxdb2-fields-displayed-in-a-measurement-in-different-time-ranges-are-different/33552/1 "2024-03-14T10:12:05Z")

</div>

![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/2/256dd0a1a927d153903bdae485a041e75c810aed.png)  
import “timezone”  
import “date”

from(bucket: “hinaiot”)  
|\> range(start: 2024-03-07T00:00:00+08:00, stop: 2024-03-07T23:59:59+08:00)  
|\> filter(fn: (r) =\> r.\_measurement == “pcsmeas”)  
|\> filter(fn: (r) =\> r.clientName == “1734496065552486402\_cntest”)  
|\> aggregateWindow(every: 1d, fn: max, createEmpty: true,location: timezone.location(name: “Asia/Shanghai”))  
|\>yield()  
the result have 23 tables. but when i only change start time  
import “timezone”  
import “date”

from(bucket: “hinaiot”)  
|\> range(start: 2023-03-07T00:00:00+08:00, stop: 2024-03-07T23:59:59+08:00)  
|\> filter(fn: (r) =\> r.\_measurement == “pcsmeas”)  
|\> filter(fn: (r) =\> r.clientName == “1734496065552486402\_cntest”)  
|\> aggregateWindow(every: 1d, fn: max, createEmpty: true,location: timezone.location(name: “Asia/Shanghai”))  
|\>yield()  
the result is only 4 tables

is influxql have some bug?

---

<div class="post-metadata">

**Author:** ![xiaopengshinidie](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/xiaopengshinidie/32/15274_2.png) [@xiaopengshinidie](https://community.influxdata.com/u/xiaopengshinidie)\
**Post date:** [March 14, 2024, 10:15am UTC](https://community.influxdata.com/t/influxdb2-fields-displayed-in-a-measurement-in-different-time-ranges-are-different/33552/2 "2024-03-14T10:15:08Z")

</div>

![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/2X/9/9c34a0acfb1e8e358bc2fc8138b6926c48448fcb.png)  
the second result

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [March 21, 2024, 8:48pm UTC](https://community.influxdata.com/t/influxdb2-fields-displayed-in-a-measurement-in-different-time-ranges-are-different/33552/3 "2024-03-21T20:48:22Z")

</div>

Hello @xiaopengshinidie  
Sorry for the delay. I was out of office.

Time Range Difference: The first query covers a single day (2024-03-07), while the second spans over a year (2023-03-07 to 2024-03-07). The range function limits the time period of the data to be considered for processing. It looks like the second picture is the one returning more results.
