# Tag History Time Weighted Average values offset by 1 day

**URL:** <https://forum.inductiveautomation.com/t/tag-history-time-weighted-average-values-offset-by-1-day/6944>\
**Category:** Ignition\
**Created:** [July 29, 2013, 6:05pm UTC](https://forum.inductiveautomation.com/t/tag-history-time-weighted-average-values-offset-by-1-day/6944 "2013-07-29T18:05:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![techerdone](https://avatars.discourse-cdn.com/v4/letter/t/9fc348/32.png) [@techerdone](https://forum.inductiveautomation.com/u/techerdone)\
**Post date:** [July 29, 2013, 6:05pm UTC](https://forum.inductiveautomation.com/t/tag-history-time-weighted-average-values-offset-by-1-day/6944/1 "2013-07-29T18:05:27Z")

</div>

I am having trouble getting my tag history query to align the dates with my data properly. I have attached pictures of my raw data from the the tag history query, the tag history properties, the property editor settings (shows the data ranges for the tag history) and a SQL query directly from the database that shows all of the actual data in the DB.

You can see that my SQL data (sqlData.jpg) has no values for 7/20 and 7/21 so the rawData for those dates should be ‘0.1’ but for some reason it shows up as being ‘0.1’ on 7/21 and 7/22 in the tag history query (rawdata.jpg). The interval for the tag history query is set to 24 hours.

Why is it showing up a day off? How do I fix this?

Ignition Platform 7.6.2 (b2368)

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/f/f274fec06d03ea7980ad9c8198c5eff4cc9f4dd1.jpg)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/4/428e4eac370f3fc0c501f1782ae36432b6077f9b.jpg)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/c/c4e7fd00a0b88a2bf697e4e4384babe11813fbf0.jpg)  
  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/b/b7c896d6691c828e65af891de28ee6b4a4ebdd8d.jpg)

---

<div class="post-metadata">

**Author:** ![Robert.McKenzie](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/robert.mckenzie/32/4134_2.png) [@Robert.McKenzie](https://forum.inductiveautomation.com/u/Robert.McKenzie)\
**Post date:** [November 28, 2013, 12:41am UTC](https://forum.inductiveautomation.com/t/tag-history-time-weighted-average-values-offset-by-1-day/6944/2 "2013-11-28T00:41:52Z")

</div>

I believe the Time Weighted Average is calculated with the time leading up to your data point. That means that at midnight, you are getting the data from the previous day.
