Hello, ::USING ACCESS 2007
I am trying to perform a calculation on the results from 2 queries.
Below those 2 queries are labled query_2 (derived from query_1) and query_3.
I would like to take the result stored as PT in query_2 and divide it by CCount and then store the result so that it can be used on a report.
I have looked around for an example of such a calculation and have had no luck yet. If I could get reference this data in VBA and output it that way, that would be wonderful.
So to be more precise,
1. How do I perform this calculation in a query?
2. Can I also do the exact same calculation in VBA?
Thanks you.
I am trying to perform a calculation on the results from 2 queries.
Below those 2 queries are labled query_2 (derived from query_1) and query_3.
I would like to take the result stored as PT in query_2 and divide it by CCount and then store the result so that it can be used on a report.
I have looked around for an example of such a calculation and have had no luck yet. If I could get reference this data in VBA and output it that way, that would be wonderful.
So to be more precise,
1. How do I perform this calculation in a query?
2. Can I also do the exact same calculation in VBA?
Code:
query_1
SELECT CName, COUNT(CName) AS PC
FROM Contact
WHERE ContactType=1 And EventDate Between Start_Date And End_Date
GROUP BY Contact.[CName];
query_2
SELECT Count(query_1.[CName]) AS PT
FROM query_1;
query_3
SELECT COUNT(*) AS CCount
FROM Client;
Thanks you.