OK. I have 2 tables, tblAnalyte and tblWQStandard. There is a one to many relationship between the 2 tables. Unique analytes are stored in tblAnalyte and water quality standards for an analyte are stored in tblWQStandard. There can be more than one standard for any analyte but only one analyte per standard stored.
I have a query with the 2 tables using a left inner join so that I keep all the records from tblAnalyte (all the analytes) but only includes those WQ standards that match with analytes in tblAnalyte (all analytes in WQ standards do match with tblAnalyte because it is an enforced relationship).
There are 500 records in tblAnalyte and 100 in tblWQStandard. Running the query above I get more than 500 because there are duplicate analytes in WQStandard. I'm only interested in showing a certain standard type (MCL) but I want to show all the analytes in tblAnalyte.
If I specify WHERE WQStandard Type = MCL then I get only 50 records because those are only the records with MCL standards. But I thought the left inner join would allow me to get what I want.
Not sure what I'm doing wrong. Any suggestions?
Vince
I have a query with the 2 tables using a left inner join so that I keep all the records from tblAnalyte (all the analytes) but only includes those WQ standards that match with analytes in tblAnalyte (all analytes in WQ standards do match with tblAnalyte because it is an enforced relationship).
There are 500 records in tblAnalyte and 100 in tblWQStandard. Running the query above I get more than 500 because there are duplicate analytes in WQStandard. I'm only interested in showing a certain standard type (MCL) but I want to show all the analytes in tblAnalyte.
If I specify WHERE WQStandard Type = MCL then I get only 50 records because those are only the records with MCL standards. But I thought the left inner join would allow me to get what I want.
Not sure what I'm doing wrong. Any suggestions?
Vince