A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

MS ACCESS 2003 Report + SQL



 
 
Thread Tools Display Modes
  #1  
Old April 4th, 2008, 10:02 AM posted to microsoft.public.access.queries
A64+
external usenet poster
 
Posts: 4
Default 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  
Old April 6th, 2008, 12:08 PM posted to microsoft.public.access.queries
NoodNutt
external usenet poster
 
Posts: 176
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 11:42 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.