# Sending Tag Data to SQL Database at specific Times

**URL:** <https://forum.inductiveautomation.com/t/sending-tag-data-to-sql-database-at-specific-times/68919>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [January 23, 2023, 4:00pm UTC](https://forum.inductiveautomation.com/t/sending-tag-data-to-sql-database-at-specific-times/68919 "2023-01-23T16:00:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brett\_Eidahl](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@Brett\_Eidahl](https://forum.inductiveautomation.com/u/Brett_Eidahl)\
**Post date:** [January 23, 2023, 4:00pm UTC](https://forum.inductiveautomation.com/t/sending-tag-data-to-sql-database-at-specific-times/68919/1 "2023-01-23T16:00:43Z")

</div>

Hello,  
I'm brand new to Ignition and our company is in the process of implementing the system for all of our printing presses. We are a small company and I'll share that I am not a programmer but am trying to learn.

We have encoders set up on each of our printing presses captures footage totals. Our shifts are from 3 AM- 3 PM each day. We currently have the encoders set to record footage and are stored on a historian tag in Ignition. We have 16 printing presses currently logging footage and each press has it's own historian tag and perspective session.

What we want to be able to do is to have Ignition take the data from the historian tag at 3 AM and 3 PM and send the total footage recorded to a SQL database that has 3 columns. WorkCenter, Date and Total Footage.

I have created the named query to insert the data into the database. What I am struggling to do is have the query run at 3 AM and 3 PM each day. Is there a way to have a query executed at specific times?

---

<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 23, 2023, 4:06pm UTC](https://forum.inductiveautomation.com/t/sending-tag-data-to-sql-database-at-specific-times/68919/2 "2023-01-23T16:06:26Z")

</div>

Use a gateway scheduled event. That script would collect the history and run the named query. You'll have to learn some jython. (Come on in! The water is fine!)

---

<div class="post-metadata">

**Author:** ![Brett\_Eidahl](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@Brett\_Eidahl](https://forum.inductiveautomation.com/u/Brett_Eidahl)\
**Post date:** [January 23, 2023, 4:19pm UTC](https://forum.inductiveautomation.com/t/sending-tag-data-to-sql-database-at-specific-times/68919/3 "2023-01-23T16:19:24Z")

</div>

Thank you! That worked perfectly
