# Alert Summary

**URL:** <https://forum.inductiveautomation.com/t/alert-summary/5606>\
**Category:** General Discussion\
**Created:** [December 20, 2012, 4:36pm UTC](https://forum.inductiveautomation.com/t/alert-summary/5606 "2012-12-20T16:36:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![David3](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@David3](https://forum.inductiveautomation.com/u/David3)\
**Post date:** [December 20, 2012, 4:36pm UTC](https://forum.inductiveautomation.com/t/alert-summary/5606/1 "2012-12-20T16:36:55Z")

</div>

We are at present developing a system that has over 50 water treatment and waste water treatment sites. I am trying to have the alert summary showing all the alarms from these plants on the home page but when you drill into individual sites the alert summary only shows these sites. I was trying to use SQL query

SELECT \*  
FROM ALERT\_LOG  
WHERE DISPLAYPATH=’{[Client]SITE\_NAME}’

I was binding this in Alerts/Data, but its not working  
anyone any ideas ?

---

<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:** [December 20, 2012, 4:42pm UTC](https://forum.inductiveautomation.com/t/alert-summary/5606/2 "2012-12-20T16:42:20Z")

</div>

It seems you are on the right track. Are all of your sites alarm history stored in a single database table? If so, you can write a query to bring back alarms for just a single site:`SELECT * 
FROM ALERT_LOG 
WHERE PATH LIKE '{[Client]SITE_NAME}%' AND ACTIVE_TIMESTAMP BETWEEN '{Root Container.Date Range.startDate}' AND '{Root Container.Date Range.endDate}'`I would use the LIKE operator in SQL to search for a pattern because you don’t want the display path to be the same for each alarm. Also, make sure you filter it on time as well. This is very similar to your query so if yours is not working post the details of the error that pops up.

---

<div class="post-metadata">

**Author:** ![David3](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@David3](https://forum.inductiveautomation.com/u/David3)\
**Post date:** [December 20, 2012, 5:17pm UTC](https://forum.inductiveautomation.com/t/alert-summary/5606/3 "2012-12-20T17:17:05Z")

</div>

Hi Travis  
I tried your code, it didn’t give back an error but it didn’t filter alarms for me either i.e all alarms are still being shown no matter what page I am on.  
Am I binding this code in the right place Alerts/Data ?

---

<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:** [December 20, 2012, 9:26pm UTC](https://forum.inductiveautomation.com/t/alert-summary/5606/4 "2012-12-20T21:26:54Z")

</div>

What is the value of the client tag calld “SITE\_NAME”?

---

<div class="post-metadata">

**Author:** ![David3](https://avatars.discourse-cdn.com/v4/letter/d/f475e1/32.png) [@David3](https://forum.inductiveautomation.com/u/David3)\
**Post date:** [December 20, 2012, 10:34pm UTC](https://forum.inductiveautomation.com/t/alert-summary/5606/5 "2012-12-20T22:34:41Z")

</div>

The value is a string for example 'BelturbetWWW ’ ,this name is used in the tag database alert name, there for if this string was in the Displaypath and it matched the alarm from the client SITE\_NAME display all these alarms will be shown. The Site\_name is enabled when you click on the button for the site you are drilling down in to.

site = ‘BELTURBET WWTW’  
system.tag.writeToTag(’[Client]SITE\_NAME’, site)

This was the idea but it doesn’t work.

---

<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:** [December 20, 2012, 10:39pm UTC](https://forum.inductiveautomation.com/t/alert-summary/5606/6 "2012-12-20T22:39:25Z")

</div>

You will probably have to give our tech support a quick call. That way we can look at everything you have to figure out what is going. Call them at (800) 266-7798 and press 2.
