C
clonesea
Unregistered / Unconfirmed
GUEST, unregistred user!
SELECT round( (Vote.Vote/(Case M.SumVote When M.SumVote=0 then
1 else
M.SumVote end ))*100,0)AS AvgVote FROM (VoteType INNER JOIN Vote ON VoteType.ID = Vote.TypeKind) INNER JOIN (SELECT VoteType.ID, sum(Vote.Vote)as SumVote FROM VoteType INNER JOIN Vote ON VoteType.ID = Vote.TypeKind GROUP BY VoteType.ID) M ON VoteType.ID = M.ID WHERE (VoteType.ID = "&ID&" ORDER BY VoteType.ID, Vote.ID
1 else
M.SumVote end ))*100,0)AS AvgVote FROM (VoteType INNER JOIN Vote ON VoteType.ID = Vote.TypeKind) INNER JOIN (SELECT VoteType.ID, sum(Vote.Vote)as SumVote FROM VoteType INNER JOIN Vote ON VoteType.ID = Vote.TypeKind GROUP BY VoteType.ID) M ON VoteType.ID = M.ID WHERE (VoteType.ID = "&ID&" ORDER BY VoteType.ID, Vote.ID