# system.tag.queryTagHistory

**URL:** <https://forum.inductiveautomation.com/t/system-tag-querytaghistory/4820>\
**Category:** Ignition\
**Created:** [July 14, 2012, 10:04pm UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory/4820 "2012-07-14T22:04:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joseph\_Mendonca](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Joseph\_Mendonca](https://forum.inductiveautomation.com/u/Joseph_Mendonca)\
**Post date:** [July 14, 2012, 10:04pm UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory/4820/1 "2012-07-14T22:04:51Z")

</div>

Can’t seem to get the interval to work. The range and everything else works except for the interval.

[code]sqldata = [‘jt 1/extag’]

intmin = event.source.parent.getComponent(‘Container’).getComponent(‘Numeric Text Field’).intValue

print intmin

data = system.tag.queryTagHistory(paths = sqldata,startDate = event.source.parent.getComponent(‘Calendar’).latchedDate,endDate = event.source.parent.getComponent(‘Calendar’).date,returnSize = 0, intervalHours = 0, intervalMinutes = intmin)  
event.source.parent.getComponent(‘Table’).data = data  
[/code]

---

<div class="post-metadata">

**Author:** ![James.Lorenz](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/james.lorenz/32/3290_2.png) [@James.Lorenz](https://forum.inductiveautomation.com/u/James.Lorenz)\
**Post date:** [July 16, 2012, 5:31pm UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory/4820/2 "2012-07-16T17:31:25Z")

</div>

It seems there is some ambiguity in your queryTagHistory parameters, as returnSize = 0 means return all data, and intervalMinutes = 10 means returns data every 10 minutes. You have to use one or the other. So if you remove the returnSize parameter from the script, it should function properly.

---

<div class="post-metadata">

**Author:** ![Joseph\_Mendonca](https://avatars.discourse-cdn.com/v4/letter/j/58f4c7/32.png) [@Joseph\_Mendonca](https://forum.inductiveautomation.com/u/Joseph_Mendonca)\
**Post date:** [July 17, 2012, 3:03am UTC](https://forum.inductiveautomation.com/t/system-tag-querytaghistory/4820/3 "2012-07-17T03:03:54Z")

</div>

Thanks, it works now.
