# Timediff SQL Ignition

**URL:** <https://forum.inductiveautomation.com/t/timediff-sql-ignition/38899>\
**Category:** Ignition\
**Created:** [September 21, 2020, 6:10pm UTC](https://forum.inductiveautomation.com/t/timediff-sql-ignition/38899 "2020-09-21T18:10:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DD\_Chelsea](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@DD\_Chelsea](https://forum.inductiveautomation.com/u/DD_Chelsea)\
**Post date:** [September 21, 2020, 6:10pm UTC](https://forum.inductiveautomation.com/t/timediff-sql-ignition/38899/1 "2020-09-21T18:10:28Z")

</div>

Hello, good afternoon everyone.

I’m actually working on a parts management system and i have a doubt about how to update a column:

The column **fecha** is the date when the call was initiated.

I need to update every 5 minutes the timediff between the column fecha and the actual time and write it on the timediff column for every row.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/a/1aeeb41b3a2290439b0274a4f60abb1c1eeb760c.png)

Do you know a way to perform this update on SQL in Ignition?

Thanks in advance for your time and help.

Regards.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [September 21, 2020, 9:31pm UTC](https://forum.inductiveautomation.com/t/timediff-sql-ignition/38899/2 "2020-09-21T21:31:40Z")

</div>

The timediff column should be a derived column rather than an actual column in your table. If you want to capture historically how long it took, then you cshould have a column that stores the DateTime the process finished as well.  
Have a look at these for time diff from now though  
[https://www.w3schools.com/sql/func\_sqlserver\_datediff.asp](https://www.w3schools.com/sql/func_sqlserver_datediff.asp)  
[https://www.w3schools.com/sql/func\_sqlserver\_getdate.asp](https://www.w3schools.com/sql/func_sqlserver_getdate.asp)

These apply for Ms sql as you didn’t specify a sql server
