Hi Keith,
First let me answer the easy question. It's MS SQL talking to an Access database.
The ultimate goal is to get all the product ids from Table A
that meet the selection criteria found in Table D.
The following are the fields I'm dealing with:
Table A
Product ID(PK)
Table B
Product ID, Freqmin, Freqmax
Table C
KeyID, KeyName
Table D
KeyID(PK), Freqmin, FreqMax
If the user selects a keyname(Table C) that results in several keyid's in Table D all the values of freqmin/freqmax need to then be compared to Table B.
Let's say keyname generated a keyid of 6, I take the keyid and count how many times I find it in Table D. Lets say there are 3 records, and the values for freq min for the 3 different records are 15.5, 18, 20.1 and the values for freqmax are 17, 20, 22.5
I now have 6 values: 15.5 - 17, 18-20, 20.1-22.5
I need to look and see if I can find those six values in the "range" of the freqmin and freqmax of Table B(PK field is FeatureID).
Example:
ProductID = 4
Freqmin = 15
Freqmax = 17
ProductID = 4
Freqmin = 30
Freqmax = 31
ProductID = 4
Freqmin = 45
Freqmax = 46
I should get a return of zero records because ProductID 4 didn't meet the 18 - 20 or the 20.1 - 22.5.
If I only had one record set from Table D and that was the 15.5 - 17 then ProductID 4 would be a valid recordset.
I hope this makes sense ..... I appreciate the help on trying to get this in "one" query.
Regards ! Tammy