Monthly, Daily averages

Discussion created by dmoran on Feb 20, 2014
Latest reply on Feb 21, 2014 by michaelh

Hi, I'm new in this, can you help me in constructing sql queries to retrieve monthly and daily average values from PI?


I have been using this query to retrieve some values every minute.


select  tag, time,cast(value as float64),  format( cast(value as float64),'##.######E+00') from piarchive..piinterp2  where (tag = 'mytagid') AND (time between ('*-60m') AND ('*')) and timestep='1m' order by 2 desc


by the way, I use c# to send the queries.


Thanx for your answer.