A have historical tag with address [default]TESTSTARTSTOP/Hours/Active power .How to make sql query the average value of this tag in the last hour?
How would you like to query your tag (with a property binding ? in a chart ? in a table ?)
One thing for sure is that you can do this using script.
I would suggest you to check out this part of the user manual :
Why not using a transaction group to store your tag ?
This way you can have control on the table name, the column where your tag will be stored and it will be easier to use complex SQL queries .
I think the queryTagCalculations function would be more appropriate: