# Help With queryTagHistory

**URL:** <https://forum.inductiveautomation.com/t/help-with-querytaghistory/3157>\
**Category:** Ignition\
**Created:** [August 5, 2011, 12:03am UTC](https://forum.inductiveautomation.com/t/help-with-querytaghistory/3157 "2011-08-05T00:03:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![denji26](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/denji26/32/5805_2.png) [@denji26](https://forum.inductiveautomation.com/u/denji26)\
**Post date:** [August 5, 2011, 12:03am UTC](https://forum.inductiveautomation.com/t/help-with-querytaghistory/3157/1 "2011-08-05T00:03:59Z")

</div>

I am attempting to use system.tag.queryTagHistory to get my tag data for a 24 hour period, from midnight to midnight of the previous day. I am specifying a returnCount of 24 in order to get data at 1 hour intervals.

What is happening is that I am getting more rows returned than I am requesting. Instead of 24, I see 41.

I have two calendar popups to get startTime and endTime. Resolution calculates the returnSize based on what intervals the user wants to use. I put specific returnSizes in to eliminate possible issues but same behavior. My call looks like this:

system.tag.queryTagHistory(tagPath, startDate = startTime, endDate = endTime, returnSize = resolution, aggregationMode = ‘Average’)

I added the keyword invocation to try and eliminate as much ambiguity as possible.

Any help would be greatly appreciated! 🙂
