Hi, I think my problem relates to a sub query I am trying to create.
I have created a simple course tracking database that creates a record for each course and includes the following fields (staff member responsible, course name, venue, start date, end date, course capacity) and a few more. The table containing all this information is called ‘Community’ and there is another table called ‘targets’ that holds the targets for each staff member.
Each of my team has an enrolment target for a given date range and must plan enough courses to meet that target and I want them to be able to run a query/report so that they can see their ongoing performance on a weekly basis within that date range.
I am trying to create a query that totals up the course capacity field for all of the records and then use this total in a new calculation that works out if that staff member has created enough courses.
Example:
Staff member A has created 30 course records in a given date range with the combined course capacities of 400. Their target is actually 500 for that data range so I want to calculate what % of their target has been planned i.e. 500/400*100 = 80% of planning target achieved.
I know:
• that I can create a totals row in a table but don’t know how to use that ‘result’ anywhere else
• that I can use the ‘sum’ option in the ‘total:’ row in a query but don’t know how to use that ‘result’ anywhere else
• I can make a calculation in a temporary field but I don’t know where to find the totals or sum results to use in my calculation created by using either of the above methods of adding up the values in a field column
I don’t know:
• How to use the results of the query ‘sum’ option in a new calculation in a new temporary field within the same query
I have tried doing this:-
SELECT Sum(course capacities) AS totalcapacities FROM community
And popping that in the ‘Field:’ box in the query but Access doesn’t like it one bit
I’ve run out of ideas so if anyone could point me in the right direction, I would really appreciate it
Many thanks,
CJW
I have created a simple course tracking database that creates a record for each course and includes the following fields (staff member responsible, course name, venue, start date, end date, course capacity) and a few more. The table containing all this information is called ‘Community’ and there is another table called ‘targets’ that holds the targets for each staff member.
Each of my team has an enrolment target for a given date range and must plan enough courses to meet that target and I want them to be able to run a query/report so that they can see their ongoing performance on a weekly basis within that date range.
I am trying to create a query that totals up the course capacity field for all of the records and then use this total in a new calculation that works out if that staff member has created enough courses.
Example:
Staff member A has created 30 course records in a given date range with the combined course capacities of 400. Their target is actually 500 for that data range so I want to calculate what % of their target has been planned i.e. 500/400*100 = 80% of planning target achieved.
I know:
• that I can create a totals row in a table but don’t know how to use that ‘result’ anywhere else
• that I can use the ‘sum’ option in the ‘total:’ row in a query but don’t know how to use that ‘result’ anywhere else
• I can make a calculation in a temporary field but I don’t know where to find the totals or sum results to use in my calculation created by using either of the above methods of adding up the values in a field column
I don’t know:
• How to use the results of the query ‘sum’ option in a new calculation in a new temporary field within the same query
I have tried doing this:-
SELECT Sum(course capacities) AS totalcapacities FROM community
And popping that in the ‘Field:’ box in the query but Access doesn’t like it one bit
I’ve run out of ideas so if anyone could point me in the right direction, I would really appreciate it

Many thanks,
CJW