If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
MS ACCESS 2003 Report + SQL
Im using a Report in MS ACCESS 2003. Ive 2 tables. One named 'Candiate_Table'
and the other named 'Votes_Table'. 'Candidate_Table' has the id of each candidates which are primary-keys. 'Vote_Table' contains votes obtained for all candidates. My Report displays the total number of votes obtained by a candidate. Now my problem arises. At the last page of the report i want to display the average votes earned by a candidate. However, i can display the total no of votes obtained by a particluar candidate with the help of 'Expression Builder' (ie, by giving '=count(*)' ). But i cant display the average votes obtained by a candidate. The table 'Vote_Table' contains votes obtained by all the candidate. So my average vote display equation should be something like this: (total_individual_candidate_vote/total_all_candidate_vote)/100. But how can i accomplish this. Do ive to write subqueries? Im a beginner. Please give me a solution. Im running out of time. Thnx, always -- Sometimes, Difficult things are possible... |
#2
|
|||
|
|||
MS ACCESS 2003 Report + SQL
G'day (Unknown/Un-Named person, you)
There's no need to be shy, It's always nice to have ones name up there so when replying we have someone to whom we can identify the facts to. Visit: http://www.mvps.org/access/netiquette.htm It has valuable insight into what everyone should do in these situations. Now, to your problem: eg if Total_Individual_Candidate_Vote = 290 Total_All_Candidate_Vote = 28125 your result would = 1.03% If it is Query based then it would be: Candidate_Vote_Percentage: (Total_Individual_Candidate_Vote/Total_All_Candidate_Vote)*100 or if it is an Unbound Control on your report then you would put this in the ControlSource: = (Total_Individual_Candidate_Vote/Total_All_Candidate_Vote)*100 HTH Mark. It's always great recieving feedback, you know, like thx, great, worked like a charm, so we know we have made your life a little happier and less complicated. |
Thread Tools | |
Display Modes | |
|
|