Query issue

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Below I have a query that I want to return all test types 2 and 3...when I
put 2 AND 3 in the criteria, it returns with not data. I do an Or statement
and it gets it. The problem with the OR is that the calulation function
seperates the two when I want the two to be added in the final report.

It Does this
AvgOfGrade CountOfExam Test type
86.60 157 2
84.08 138 3

I want this...totals!
170.68 295 5

SELECT Avg(Grade.Grade) AS AvgOfGrade, Count([Exam Archive File].Exam) AS
CountOfExam, [Exam Archive File].[Test type]
FROM Grade INNER JOIN [Exam Archive File] ON Grade.[Record Number]=[Exam
Archive File].[Record Number]
GROUP BY [Exam Archive File].[Test type]
HAVING ((([Exam Archive File].[Test type])=2)) OR ((([Exam Archive
File].[Test type])=3));

Does anyone know how to resolve this issue?

Thank you for your help in advance.
 
SELECT Avg(Grade.Grade) AS AvgOfGrade,
Count([Exam Archive File].Exam) AS CountOfExam,
Sum([Exam Archive File].[Test type]) AS SumOfTestType
FROM Grade INNER JOIN [Exam Archive File]
ON Grade.[Record Number]=[Exam Archive File].[Record Number]
WHERE [Exam Archive File].[Test type] in(2,3);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Multiple Forms 3
Union Query 1
string crosstab query 1
2 complicated queries 5
Limiting the time in a Query 8
Possible Macro or formula 2
Highest and Lowest Numbner 3
Updatable Table filtered by Query 2

Back
Top