I have about 10 different buttons that reflect a department for each one. I am wanting to be able to select a button and it fire a sql query to retrieve information from a table that have the rows that equate to that department. So if I select the safety department, my designated numeric text field updates with the average safety number of all the rows that have the safety area in the column. here is what I have so far:
//event.source.parent.getComponent(‘Saverage’).intValue = system.db.runQuery("SELECT AVG(CAST(Safety AS int)) AS SafetyNumber FROM SQDCME.dbo.SQDCME where Area = ‘Stacker1’ ")//
The problem is that I get an error back saying:
File “event:actionPerformed”, line 23, in
AttributeError: ‘NoneType’ object has no attribute ‘intValue’
Basically I am trying to get the average safety number from the Safety column that has all the rows with the Stacker1 area in it.