Bug #2772
closedDBA: doesn't read planted stems when calculating plots without data
0%
Description
plots without data need ot really have no data: no planted and no natural stems.
Updated by Michael Lee almost 18 years ago
chk_lackdata_stems new SQL:
SELECT observation.PROJECT_ID, entry_plots_stems.plotID, observation.authorObsCode AS Plot, observation.cust_cvs_samplingLevel AS [level], Count(entry_stems.plotID) AS [total Records], Sum(([IsIndividualRecord]=False)*-1) AS [Count Natural Stem Records], Sum(([IsIndividualRecord]=True)*-1) AS [Count Of Planted Stem Records]
FROM (observation LEFT JOIN entry_plots_stems ON observation.OBSERVATION_ID = entry_plots_stems.plotID) LEFT JOIN entry_stems ON entry_plots_stems.plotID = entry_stems.plotID
GROUP BY observation.PROJECT_ID, entry_plots_stems.plotID, observation.authorObsCode, observation.cust_cvs_samplingLevel
HAVING (((Count(entry_stems.plotID))=0)) OR (((observation.cust_cvs_samplingLevel)=1) AND ((Sum(([IsIndividualRecord]=True)*-1)) Is Null Or (Sum(([IsIndividualRecord]=True)*-1))=0)) OR (((observation.cust_cvs_samplingLevel)=3 Or (observation.cust_cvs_samplingLevel)=4 Or (observation.cust_cvs_samplingLevel)=5) AND ((Sum(([IsIndividualRecord]=False)*-1)) Is Null Or (Sum(([IsIndividualRecord]=False)*-1))=0)) OR (((observation.cust_cvs_samplingLevel)=2) AND ((Sum(([IsIndividualRecord]=False)*-1)) Is Null Or (Sum(([IsIndividualRecord]=False)*-1))=0) AND ((Sum(([IsIndividualRecord]=True)*-1)) Is Null Or (Sum(([IsIndividualRecord]=True)*-1))=0));