query help

  • Thread starter Thread starter dabwang
  • Start date Start date
D

dabwang

Guest
i am having some trouble with a query. i have a table that contains info on students test results. first is it possible to somehow group entries where the students names are the same so that u can get a total for a particular name.

secondly, the same student can take different topics so this is a second type of group. as students can take the different tests under the same topic the results need to be added together

so in the end i need some way of looking at sudents results which are grouped by topic and by name with totals calculated

any help will be grateful as i am really stuck

nige
 
This all really depends on your table and database structure. If this has been done fairly simply, then a simple select query such as ...

SELECT StudentName, SUM(results) as TotalResults
FROM StudentsTable
GROUP BY StudentName

would give you the first query, and


SELECT StudentName, Topic, SUM(results) as TotalResults
FROM StudentsTable
GROUP BY StudentName, Topic

would give you the second. However without knowing how you have structured the database (tables, fields etc) it is not really possible to give you nuch more help

Regards

Ian
 
that works great!!

many thanks
nige
 
Last edited:

Users who are viewing this thread

Back
Top Bottom