Limno BB Average

folks seem happy with changes - i'd swap queries if approved.

---
I do not see differences -- I may be doing something we did not envision. results of work can be seen through at these two links

old: http://mcmlter.org/queries/lakes/bluebox_queries.jsp
new: http://mcmlter.org/queries/lakes/bluebox_queries_fd.jsp

---------------
OK, suggested calculation based on 0 to 24h, but currently, computation is from 00:20 to 24.

problem with aggregation on day-of-year is that is has no info about which year, so need to add year-field to group-by

i.e, the following works (no-abl)

SELECT a."LOCATION NAME",
a.DAY_OF_YEAR,
a.YEAR_FIELD,
MIN(TO_DATE (TO_CHAR (a.date_time, 'MM/DD/YYYY'), 'MM/DD/YYYY'))
AS DATE_TIME,
ROUND (AVG (a.STAGE), 3) AS AVG_STAGE,
ROUND (STDDEV (a.STAGE), 3) AS STDDEV_STAGE,
MIN (a.STAGE) AS MIN_STAGE,
MAX (a.STAGE) AS MAX_STAGE,
COUNT (a.STAGE) AS N_STAGE,
ROUND (AVG (a."SURFACE PAR"), 3) AS AVG_SURFACE_PAR,
ROUND (STDDEV (a."SURFACE PAR"), 3) AS STDDEV_SURFACE_PAR,
MIN (a."SURFACE PAR") AS MIN_SURFACE_PAR,
MAX (a."SURFACE PAR") AS MAX_SURFACE_PAR,
COUNT (a."SURFACE PAR") AS N_SURFACE_PAR,
ROUND (AVG (a."UW_PAR"), 3) AS AVG_UW_PAR,
ROUND (STDDEV (a."UW_PAR"), 3) AS STDDEV_UW_PAR,
MIN (a."UW_PAR") AS MIN_UW_PAR,
MAX (a."UW_PAR") AS MAX_UW_PAR,
COUNT (a."UW_PAR") AS N_UW_PAR
FROM LIMNO_BLUE_BOX a
GROUP BY a."LOCATION NAME",
a.YEAR_FIELD,
a.DAY_OF_YEAR;

Status: 

Priority: 

Normal