Getting % As Total A97

K

Kahuna

Hi Folks - using the following query I calculate a total area based on three
criteria.

SELECT qryFabricCondition.fc_base_year1 AS [Base Year],
Sum(budget_schedules.bs_m2) AS [Area M2], qryFabricCondition.fc_ccr_value AS
Criticality
FROM qryFabricCondition INNER JOIN budget_schedules ON
qryFabricCondition.fc_id = budget_schedules.fc_fabric_key
WHERE (((qryFabricCondition.ad_analysis_code)>"20"))
GROUP BY qryFabricCondition.fc_base_year1, qryFabricCondition.fc_ccr_value
HAVING (((qryFabricCondition.fc_base_year1) Is Not Null));

Is there an easy way to generate the % each area represents of the total of
all areas, within the same query?

Appreciate any feedback.
 
M

Michel Walsh

Sure, something like:

SELECT ... ,
SUM(budget_schedules.bs_m2) AS [Area M2] / (SELECT SUM(bs_m2) FROM
budget_schedules),
...


Hoping it may help,
Vanderghast, Access MVP
 
K

Kahuna

WOW Michel - that makes sense!

I'll give it a try thanks.

Cheers

--
Kahuna
------------
Michel Walsh said:
Sure, something like:

SELECT ... ,
SUM(budget_schedules.bs_m2) AS [Area M2] / (SELECT SUM(bs_m2) FROM
budget_schedules),
...


Hoping it may help,
Vanderghast, Access MVP


Kahuna said:
Hi Folks - using the following query I calculate a total area based on
three criteria.

SELECT qryFabricCondition.fc_base_year1 AS [Base Year],
Sum(budget_schedules.bs_m2) AS [Area M2], qryFabricCondition.fc_ccr_value
AS Criticality
FROM qryFabricCondition INNER JOIN budget_schedules ON
qryFabricCondition.fc_id = budget_schedules.fc_fabric_key
WHERE (((qryFabricCondition.ad_analysis_code)>"20"))
GROUP BY qryFabricCondition.fc_base_year1,
qryFabricCondition.fc_ccr_value
HAVING (((qryFabricCondition.fc_base_year1) Is Not Null));

Is there an easy way to generate the % each area represents of the total
of all areas, within the same query?

Appreciate any feedback.
 

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