Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Cyclonik
Posting Yak Master
114 Posts |
Posted - 2001-03-14 : 18:09:48
|
| I am having some trouble coming up with a solution for summing up data.I have a test which is stored in 2 tables. one with the test infotestid|testee|tester|date|notesand a table with the scorestestid|questionid|scorewhat i need is a record which returns the average score for each question id in its own column.i am not sure if i can do this or not in one select statement.i can do it easily for one particular question like this (obvious)...SELECT AVG(c.Points) as CE1, COUNT(distinct a.monitor_id) as TotalMonitors, b.Fname,b.Lname,a.lanid From tblVoice_MonitorsT a JOIN tblUsersT b ON a.lanid=b.lanid JOIN tblVoice_monitor_scores_idx c ON a.monitor_id=c.monitor_idWHERE a.lanid = @id AND (a.monitor_date BETWEEN @datestart AND @dateendOR a.monitor_date Is Null) and criteria_id = 1GROUP BY b.Lname,b.Fname,a.lanidThanks in advanceChristian-=:SpasmatiK:=- |
|
|
|
|
|