The attached image shows the following query with data:
SELECT m.YYYY, m.LastYearCount, m.CurrYearCount, m., m., m., m., m., m., m., m., m., m., m., m., m.MedCtr_ID, m.StatType_ID
FROM tMonthlyMedCenter m
WHERE (((m.YYYY)=fnYYYY()) AND ((m.MedCtr_ID)=2) AND ((m.StatType_ID)=14 Or (m.StatType_ID)=15));
Currently, there are two rows filtered by StatType 14, and 15. This query needs to find % for each column and turn it to a single row showing % values from , ,... using:
Percent_01: ( StatType15) / ( StatType14)
There StatTypes other than 14 and 15. In some other question, I will expand the scope to see how far it could go.
Question: How can this calculation could be done with a single query?
Because performance is of a concern, I am open to another way of doing this also (for instance storing some of the rows in tem table or using VBA to do it).