G
Glen
I have inherited a problem that I have narrowed to one SQL statement.
I am having great difficulty fixing this problem and greatly appreciate
any help. Here is the SQL:
strSQL = "SELECT tbl_QA_Junc.QA_ID, tbl_QA_Junc.Cat_ID,
tbl_Main_QA.Tech_Code FROM tbl_Main_QA RIGHT JOIN tbl_QA_Junc ON
tbl_Main_QA.QA_ID = tbl_QA_Junc.QA_ID GROUP BY tbl_QA_Junc.QA_ID,
tbl_QA_Junc.Cat_ID, tbl_Main_QA.Tech_Code HAVING (((tbl_QA_Junc.Cat_ID)
In (" & strFilt & ")) AND ((tbl_Main_QA.Tech_Code) In (" & stCodeFilt &
")));"
I have a form where the user selects different categories to generate a
list of questions. The Main_QA table holds a general technical code
for the associated questions (i.e. electrical, mechanical, structural,
etc.). The QA_Junc table holds several categories associated with the
technical code questions. The QA_ID is the primary key for the MAIN_QA
table and is used in the QA_Junc table for cross-referencing.
strCodeFilt = numerical values assigned to tech codes (1-8)
strFilt = numerical values assigned to the categories (15-78)
Problem:
The way this functions now is to create a complete list of distinct
questions. I need it to create a list of exclusive questions.
For example: Suppose a user selects ALL technical codes (177
questions) and then selects a Conceptual category (23 of the 177
questions) and a Schematic category (55 of the 177 questions). This
will generate 78 questions total. A filter discovers that 20 of the
conceptual questions are duplicates so the generated report has 58
questions. I need the report to generate the 20 duplicates exclusive
to both schematic and conceptual categories and not the 58 distinct
questions.
Thank you for taking the time to read this and again, any help would be
greatly appreciated.
I am having great difficulty fixing this problem and greatly appreciate
any help. Here is the SQL:
strSQL = "SELECT tbl_QA_Junc.QA_ID, tbl_QA_Junc.Cat_ID,
tbl_Main_QA.Tech_Code FROM tbl_Main_QA RIGHT JOIN tbl_QA_Junc ON
tbl_Main_QA.QA_ID = tbl_QA_Junc.QA_ID GROUP BY tbl_QA_Junc.QA_ID,
tbl_QA_Junc.Cat_ID, tbl_Main_QA.Tech_Code HAVING (((tbl_QA_Junc.Cat_ID)
In (" & strFilt & ")) AND ((tbl_Main_QA.Tech_Code) In (" & stCodeFilt &
")));"
I have a form where the user selects different categories to generate a
list of questions. The Main_QA table holds a general technical code
for the associated questions (i.e. electrical, mechanical, structural,
etc.). The QA_Junc table holds several categories associated with the
technical code questions. The QA_ID is the primary key for the MAIN_QA
table and is used in the QA_Junc table for cross-referencing.
strCodeFilt = numerical values assigned to tech codes (1-8)
strFilt = numerical values assigned to the categories (15-78)
Problem:
The way this functions now is to create a complete list of distinct
questions. I need it to create a list of exclusive questions.
For example: Suppose a user selects ALL technical codes (177
questions) and then selects a Conceptual category (23 of the 177
questions) and a Schematic category (55 of the 177 questions). This
will generate 78 questions total. A filter discovers that 20 of the
conceptual questions are duplicates so the generated report has 58
questions. I need the report to generate the 20 duplicates exclusive
to both schematic and conceptual categories and not the 58 distinct
questions.
Thank you for taking the time to read this and again, any help would be
greatly appreciated.