Hi everyone,
I could use some guidance on how to "transform" two tables.
My database contains data on stream sampling locations identified by UIDs. These locations either pass (1) or fail (0). There are different methods of determining whether a sampling location passes or fails.
Table one (tbl_StressorData) contains the raw data used to determine whether a UID passes or fails. It contains UID, region (one of two), and 8 stressor variables.
Table two (qry_Filter_AH) is actually a query. This query "analyses" the stressor data using 11 different methods (denoted by P10V4, P25V1, P25V2 etc...) and returns either a pass (1) or a fail (0) under each method for each sampling location. This table contains pass fail results only for one of the two regions (algonquin highlands [AH]).
What I would like to do is create a table that has as the first column all of the 11 methods. The subsequent columns would be Min(RLPC), Max(RLPC) etc... for all stressor variables up to Min(Stressor8), Max(Stressor8).
The complicating factor is that for each method I want only the min and max stressor variables of the "passing" sites.
So for method P10V4 I want Min(all stressors) and Max(all stressors) where qry_Filter_AH.P10V4 = 1.
For method P25V1 I want Min(all stressors) and Max(all stressors) where qry_Filter_AH.P25V1 = 1.
I hope this makes sense, any comments or guidance is appreciated. The attached screenshot shows the original table and query that I am working from.