Lavenderchan
Technical User
Hello,
I am currently to to summarized data so I can create a pie chart in Access 2010. What I have done is tried a union with different number of columns however I am unable to get it to work. If this is not the right approach suggestions are always welcome.
SELECT distinct [Cleveland Assigned REAC].reac_last_inspection_score
AS "No Score", null as "30-49", null AS "50-69", null AS "70-79", null as "80-89", null as
"90-100"
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score)<"0"));
Union
SELECT distinct [Cleveland Assigned REAC].reac_last_inspection_score
AS "30-49", null AS "50-69", null AS "70-79", null as "80-89", null as
"90-100"
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score) Between
"30" And "49"));
Union
SELECT distinct AVG([Cleveland Assigned
REAC].reac_last_inspection_score) AS "50-69", null AS "30-49" ,null AS "70-79", null as "80-89", null as "90-100"
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score) Between
"50" And "69"));
group by [Cleveland Assigned REAC].property_id, Cleveland Assigned
REAC].reac_last_inspection_score
Union
SELECT distinct AVG([Cleveland Assigned
REAC].reac_last_inspection_score) AS "70-79"
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score) Between
"70" And "79"));
group by [Cleveland Assigned REAC].property_id, Cleveland Assigned
REAC].reac_last_inspection_score
Union
SELECT distinct AVG([Cleveland Assigned
REAC].reac_last_inspection_score) AS 80-89
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score) Between
"80" And "89"));
group by [Cleveland Assigned REAC].property_id, Cleveland Assigned
REAC].reac_last_inspection_score
Union
SELECT distinct AVG([Cleveland Assigned
REAC].reac_last_inspection_score) AS 90-100
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score) Between
"90" And "100"));
group by [Cleveland Assigned REAC].property_id, Cleveland Assigned
REAC].reac_last_inspection_score
Thanks,
Keri
I am currently to to summarized data so I can create a pie chart in Access 2010. What I have done is tried a union with different number of columns however I am unable to get it to work. If this is not the right approach suggestions are always welcome.
SELECT distinct [Cleveland Assigned REAC].reac_last_inspection_score
AS "No Score", null as "30-49", null AS "50-69", null AS "70-79", null as "80-89", null as
"90-100"
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score)<"0"));
Union
SELECT distinct [Cleveland Assigned REAC].reac_last_inspection_score
AS "30-49", null AS "50-69", null AS "70-79", null as "80-89", null as
"90-100"
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score) Between
"30" And "49"));
Union
SELECT distinct AVG([Cleveland Assigned
REAC].reac_last_inspection_score) AS "50-69", null AS "30-49" ,null AS "70-79", null as "80-89", null as "90-100"
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score) Between
"50" And "69"));
group by [Cleveland Assigned REAC].property_id, Cleveland Assigned
REAC].reac_last_inspection_score
Union
SELECT distinct AVG([Cleveland Assigned
REAC].reac_last_inspection_score) AS "70-79"
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score) Between
"70" And "79"));
group by [Cleveland Assigned REAC].property_id, Cleveland Assigned
REAC].reac_last_inspection_score
Union
SELECT distinct AVG([Cleveland Assigned
REAC].reac_last_inspection_score) AS 80-89
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score) Between
"80" And "89"));
group by [Cleveland Assigned REAC].property_id, Cleveland Assigned
REAC].reac_last_inspection_score
Union
SELECT distinct AVG([Cleveland Assigned
REAC].reac_last_inspection_score) AS 90-100
FROM [Cleveland Assigned REAC]
WHERE ((([Cleveland Assigned REAC].reac_last_inspection_score) Between
"90" And "100"));
group by [Cleveland Assigned REAC].property_id, Cleveland Assigned
REAC].reac_last_inspection_score
Thanks,
Keri