Reputation: 115
I have a 'student' table with details of id,name,sex,age,year,gpa of students. I have another table 'major' table with the ids of students and the course which the major in(dname).
I would like to find the difference in age between the oldest student and the youngest student majoring in 'Computer Sciences'. This has proved difficult for me since the total function does not include 'range'.
When I try to find the difference between the maximum and minimum age using 'expression' in the total function I get this error....."Your query does not include the specified expression 'age' as part of an aggregate function"
How should i go about this to find the difference between the maximum and minimum age?
Upvotes: 0
Views: 1792
Reputation: 12353
Change Total:
from Group By to Expression and define the criteria in Field:
(see below).
Upvotes: 1
Reputation: 4100
Change the first field of the query as follows:
age
) with the formula Max([age])-Min([age])
Upvotes: 1