Link to home
Start Free TrialLog in
Avatar of gianitoo
gianitoo

asked on

voting query not working anymore

this query is working perfectly in access.  i created the table same structure in sql server 2005 and it wont show the percentages.  it says 0 as results

SELECT TOP 6 Count(vote.voteid) AS ['Count Of Teams'], racerinfo.racername, (((Count(vote.voteid))/(select count(voteid) from vote))*100) AS TotalPercentage
FROM vote, racerinfo
WHERE (((vote.voteid)=[racerinfo].[ID]))
GROUP BY racerinfo.racername, vote.voteid
ORDER BY Count(vote.voteid) DESC
Avatar of rboyd56
rboyd56

So the query returns no records?

If this is the case, have you verified that there are records in the vote table that have a corresponding record in the racerinfo table based on the voteod and ID columns.
Avatar of gianitoo

ASKER

no only for percentage column.   i know i have many votes

can u look to see if query looks ok
TSQL is not my strongest point so I may not be the best to say, but it looks OK to me.
ASKER CERTIFIED SOLUTION
Avatar of dready
dready

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial