Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

Multiable SECETS

$
0
0
This is not working. Not a master at SQL so could use some help.

SELECT
AVG(reading) AS overall,
AVG(reading) AS 7DAY WHERE (readdate >= CURDATE() - INTERVAL 7 DAY) AND (reading > 0) AND (readdate < CURDATE() + INTERVAL 7 DAY),
AVG(reading) AS 14DAY WHERE (readdate >= CURDATE() - INTERVAL 14 DAY) AND (reading > 0) AND (readdate < CURDATE() + INTERVAL 14 DAY)
FROM meter

I want to display this in a Dashboard Panel as 7 Day Average, 14 Day Average, Overall Average.

Viewing all articles
Browse latest Browse all 2586

Latest Images

Trending Articles



Latest Images