Calculating Percentage of Column Data

G

Guest

I have a query which has parameters from the
Form.(Forms!Products!Poduct_Name) with the number of Products. The numbers of
Products are count of number of IDs.

That is

Product Name, Count(Name).
AB 35
BC 82 etc..

My issue is to I would like to calculate the percentage of this Counts like

Product Name, Count(Name). Percentage
AB 35 (Count/Total(Count))
BC 82 etc..

Is there any way I can do this in a query. (Total(Count) is always varying
according to the selection of the Form)

Any help. Really Appreciated

Thank you
 
G

Guest

Try this ---
Query Lin ---
SELECT Count(Products.ID) AS CountOfID
FROM Products;

SELECT Products.[Product Name], Count([ID])/[Lin].[CountOfID]*100 AS
[Percent of Products]
FROM Products, Lin
GROUP BY Products.[Product Name], Lin.CountOfID
HAVING (((Products.[Product Name])=[Forms]![Products]![Poduct_Name]));

It is simpler if you use a subquery.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top