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  

% of total needed



 
 
Thread Tools Display Modes
  #1  
Old January 12th, 2009, 11:15 PM posted to microsoft.public.access.queries
christine t.
external usenet poster
 
Posts: 7
Default % of total needed

I need to add a field showing the % of total. The table looks like this:

Company Name Category Type Paid Amount % of Total Paid Amount

Armstrong Copy Paper $50.00 ?
Jonas Envelopes $50.00 ?

Thanks!
--
c.t.
  #2  
Old January 13th, 2009, 12:54 AM posted to microsoft.public.access.queries
John W. Vinson
external usenet poster
 
Posts: 18,261
Default % of total needed

On Mon, 12 Jan 2009 15:15:01 -0800, christine t.
wrote:

I need to add a field showing the % of total. The table looks like this:

Company Name Category Type Paid Amount % of Total Paid Amount

Armstrong Copy Paper $50.00 ?
Jonas Envelopes $50.00 ?

Thanks!


SELECT [Company Name], [Category Type], [Paid Amount], [Paid Amount] /
DSum("[Paid Amount]", "[tablename]", "optional criteria") AS [% of Total
Paid Amount] FROM tablename;

--

John W. Vinson [MVP]
  #3  
Old January 13th, 2009, 01:58 AM posted to microsoft.public.access.queries
Marshall Barton
external usenet poster
 
Posts: 5,361
Default % of total needed

christine t. wrote:

I need to add a field showing the % of total. The table looks like this:

Company Name Category Type Paid Amount % of Total Paid Amount

Armstrong Copy Paper $50.00 ?
Jonas Envelopes $50.00 ?



You should not put calculated values in a table. That kind
of thing should be calculated when the records are displayed
in a form or report.

Use an text box (named txtTotal) with an expression like:
= Sum([Paid Amount[)
in the form/report header section, or in a report's group
header section. Then the percent text box would use an
expression like:
= [Paid Amount] / txtTotal

--
Marsh
MVP [MS Access]
 




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 03:42 PM.


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