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 |
missinglct
Yak Posting Veteran
75 Posts |
Posted - 2004-04-15 : 13:44:11
|
Hi experts,Need some ideas on how to develop this.The survey consists of 50 questions. The requirement is: Group some answers together and get the total. Fx: Very great extentGreat extentModerate extentNot at allDo not applyN/A |
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2004-04-16 : 05:28:23
|
Looks like you need a 2nd table to categorise/group the answer categories into logical groups.answer answergroupVery great extent GREATGreat extent GREATModerate extent MODERATESlight extent SLIGHTNone at all SLIGHTDo not know/No basis to judge NOSCORENot applicable NOSCOREif you join your answer table to the mini-table above on name (or even bettter code if it exists) then you should be able to GROUP BY the answeergroup value....and exclude the NOSCORE's to get some progress.YOU could hard-code a solution using 'case' statements....but that then restricts futures re-use of the survey. |
|
|
missinglct
Yak Posting Veteran
75 Posts |
Posted - 2004-04-16 : 14:47:59
|
Thanks for your great idea. I have thought about that design but we can't use that design now. I forgot to mention that the new requirement came in late (after we have already collected the data from the users). I mean, I can still get this resolved with all the existing data but then I have to use GROUP BY to combine those answers and there would be a bunch of sql queries involved and that's time consuming. But if that is the only solution, then I just have to go for it. Thx again. |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2004-04-19 : 05:23:38
|
you could always 'manually present the data'....after all......which executive is going to be re-running the queries interactively......the answers won't change once the votes are in!!!! |
|
|
missinglct
Yak Posting Veteran
75 Posts |
Posted - 2004-04-19 : 10:52:53
|
Ok, I have done some more thinking over the weekend and I think it is going to work by creating more tables that link to the result table(maybe not the best solution). |
|
|
|
|
|