# How do I sum the values of a column of a table component?

**URL:** <https://forum.inductiveautomation.com/t/how-do-i-sum-the-values-of-a-column-of-a-table-component/33837>\
**Category:** Ignition\
**Created:** [April 10, 2020, 1:37am UTC](https://forum.inductiveautomation.com/t/how-do-i-sum-the-values-of-a-column-of-a-table-component/33837 "2020-04-10T01:37:59Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![MaGottschalk](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@MaGottschalk](https://forum.inductiveautomation.com/u/MaGottschalk)\
**Post date:** [April 10, 2020, 7:07am UTC](https://forum.inductiveautomation.com/t/how-do-i-sum-the-values-of-a-column-of-a-table-component/33837/2 "2020-04-10T07:07:39Z")

</div>

Hello Felipe,

summing up the hfiNumber for a specific machine and a specific date could be done in SQL. As I’m using MSSQL, I’m not 100% sure about the correct syntax for MySQL.

```auto
SELECT 
    SUM(hfiNumber) as hfi
    , date(timeStamp) as dt
FROM hfi
  
where
	machine like 'Cupper'
	and HOUR(dt)>=7 and HOUR(dt)<19
group by date(timeStamp)
order by dt

```

This should give you the sum of hfiNumbers for the **Cupper** machine for the 7am to 7pm shift for each day.

In order to edit or delete a line you just need to read the selectedRow property of your table, get the values (see [http://forum.inductiveautomation.com/t/how-to-extract-the-value-of-the-selected-row/8817](http://forum.inductiveautomation.com/t/how-to-extract-the-value-of-the-selected-row/8817)) and then run the wanted SQL update or delete command.

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-do-i-sum-the-values-of-a-column-of-a-table-component/33837)._
