I am giving a report on DB data.
For each "level", i.e. 1-5, I retrieve how many selected each of them, such as:
SELECT LikertLevel, Count(*) AS CountSelected FROM Response WHERE QuestId=" & Session("QuestId"
& " And AlternativeId=" & altIdList(i) & " GROUP BY LikertLevel
With this I get:
1 5
2 3
3 4
which means 5 selected level1, 3 selected level 2 etc...
Can I in the same query also retrieve the sum of the 'CountSelected' field, (5+3+4)? I tried with an extra
SUM(CountSelected) in the Select, but that didn't work.
I need this to calcualte the percentage. I can of course retrieve all values as above, store them in a list and then add them, but that seems unnecessary.
Thanks for your help
For each "level", i.e. 1-5, I retrieve how many selected each of them, such as:
SELECT LikertLevel, Count(*) AS CountSelected FROM Response WHERE QuestId=" & Session("QuestId"
With this I get:
1 5
2 3
3 4
which means 5 selected level1, 3 selected level 2 etc...
Can I in the same query also retrieve the sum of the 'CountSelected' field, (5+3+4)? I tried with an extra
SUM(CountSelected) in the Select, but that didn't work.
I need this to calcualte the percentage. I can of course retrieve all values as above, store them in a list and then add them, but that seems unnecessary.
Thanks for your help