# Delet records older than

**URL:** <https://forum.inductiveautomation.com/t/delet-records-older-than/4370>\
**Category:** Ignition\
**Created:** [April 27, 2012, 6:54pm UTC](https://forum.inductiveautomation.com/t/delet-records-older-than/4370 "2012-04-27T18:54:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![moralesm](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@moralesm](https://forum.inductiveautomation.com/u/moralesm)\
**Post date:** [April 27, 2012, 6:54pm UTC](https://forum.inductiveautomation.com/t/delet-records-older-than/4370/1 "2012-04-27T18:54:00Z")

</div>

When the delet older records option is selected for my historical transaction group, the entire table seems to be deleted instead of trimming the records older then the selected time. Is this the correct behavior or do I have something misconfigured?

---

<div class="post-metadata">

**Author:** ![Travis.Cox](https://avatars.discourse-cdn.com/v4/letter/t/b9bd4f/32.png) [@Travis.Cox](https://forum.inductiveautomation.com/u/Travis.Cox)\
**Post date:** [April 27, 2012, 8:35pm UTC](https://forum.inductiveautomation.com/t/delet-records-older-than/4370/2 "2012-04-27T20:35:51Z")

</div>

That is not the expected behavior. It must be something with your configuration. Can you call our tech support or post a backup of that transaction group?

---

<div class="post-metadata">

**Author:** ![moralesm](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@moralesm](https://forum.inductiveautomation.com/u/moralesm)\
**Post date:** [April 27, 2012, 9:11pm UTC](https://forum.inductiveautomation.com/t/delet-records-older-than/4370/3 "2012-04-27T21:11:00Z")

</div>

I was not trying to do any thing fancy. And I should clarify, the table itself was not being deleted but all the records would be deleted. I would have expected the table to consistantly hav ~ 120 entris since I am deleting after 3 minutes.  
[demo\_2012-04-27\_1602\_partial.proj](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2ebe9b942d7199a770c3e81b425ec489978505ea.proj) (3.83 KB)

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [April 27, 2012, 10:25pm UTC](https://forum.inductiveautomation.com/t/delet-records-older-than/4370/4 "2012-04-27T22:25:47Z")

</div>

Hi,

What kind of database are you using? While I’ve never seen this particular issue, sometimes time-based operations run into trouble because of different database data types/behaviors. Also, in addition to the type of database, perhaps you could take a look at the table definition using the appropriate tool and let us know what the timestamp column is defined as. Hopefully we can mock it up and track down what’s going on.

Thanks,

---

<div class="post-metadata">

**Author:** ![moralesm](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@moralesm](https://forum.inductiveautomation.com/u/moralesm)\
**Post date:** [April 30, 2012, 3:09pm UTC](https://forum.inductiveautomation.com/t/delet-records-older-than/4370/5 "2012-04-30T15:09:43Z")

</div>

I think I may have figured this out. I am using a MySQL (t\_stamp was datetime) database but it is installed on a separate machine from Ignition. The problem I believe was that the two computers times were not synced ~2 ahead on the database computer. I noticed this when I set the option to delete older than 10 min and saw the behavior I was expecting. Thanks for the guidance.

---

<div class="post-metadata">

**Author:** ![Colby.Clegg](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/colby.clegg/32/3282_2.png) [@Colby.Clegg](https://forum.inductiveautomation.com/u/Colby.Clegg)\
**Post date:** [April 30, 2012, 3:19pm UTC](https://forum.inductiveautomation.com/t/delet-records-older-than/4370/6 "2012-04-30T15:19:28Z")

</div>

Ah, yeah. Unfortunately we do the date arithmetic on the Ignition machine, to avoid complications with different databases, which means that this system is susceptible to problems with time synchronization.

Anyhow, glad you figured it out.

Regards,
