# system.tag.queryTagHistory() not fetching results

**URL:** <https://forum.inductiveautomation.com/t/system-tag-querytaghistory-not-fetching-results/101095>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 20, 2025, 10:09am UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-not-fetching-results/101095 "2025-01-20T10:09:12Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mustajab](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mustajab](https://forum.inductiveautomation.com/u/Mustajab)\
**Post date:** [January 20, 2025, 10:09am UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-not-fetching-results/101095/1 "2025-01-20T10:09:12Z")

</div>

Hello,  
I am using the following code which returns 0 rows:

```python
endTime = system.date.now()
startTime = system.date.addMinutes(endTime, -30)
system.tag.queryTagHistory(paths=['[default]Stations/Station1/Devices/UDT1/Booltag1'], startDate=startTime, endDate=endTime, returnSize=-1, returnFormat='Wide')

```

I have another piece of code for another application which works well and returns expected results for the same tag:

```python
data = system.tag.queryTagHistory(
            paths=[dynamictagpath], startDate=start_time, endDate=end_time,
            intervalHours=24, aggregationMode="Maximum", returnSize=X
        )

```

Is there a problem with the syntax or anything else?

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [January 20, 2025, 12:40pm UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory-not-fetching-results/101095/2 "2025-01-20T12:40:24Z")

</div>

Are you sure you have samples recorded in that timeframe? Consider setting max time between samples on your tags to an interval smaller than the smallest desired chart timespan.
