Hellow everyone,
I have the following query:
SELECT Year, School, Number
FROM tblStudentNumber
GROUP BY Year, Number, School
ORDER BY School, Year
(quite simple
I want divide the field [number] with a sum over the numbers, within a school group...
Something like:
[number]/sum([number],"school")
and the second summerize should be with the year field
if the year is 2004, then number in 2004 minus number in 2003 for the school
something like:
([number], year=2004) - ([number],year=2003)
I could make select in select statements
(select year, number from tblStudentNumber where year = 2003)
(select year from, number tblStudentNumber where year = 2004)
and for the summerize:
(select sum(number) from tblStudentNumber where year = 2003 and school = 1)
(select number from tblStudentNumber where year = 2003 and school = 1)
but that would make a lot of select queries.
Please advise!
I have the following query:
SELECT Year, School, Number
FROM tblStudentNumber
GROUP BY Year, Number, School
ORDER BY School, Year
(quite simple
I want divide the field [number] with a sum over the numbers, within a school group...
Something like:
[number]/sum([number],"school")
and the second summerize should be with the year field
if the year is 2004, then number in 2004 minus number in 2003 for the school
something like:
([number], year=2004) - ([number],year=2003)
I could make select in select statements
(select year, number from tblStudentNumber where year = 2003)
(select year from, number tblStudentNumber where year = 2004)
and for the summerize:
(select sum(number) from tblStudentNumber where year = 2003 and school = 1)
(select number from tblStudentNumber where year = 2003 and school = 1)
but that would make a lot of select queries.
Please advise!