Count row percentage between different tables (1 Viewer)

rockovo

New member
Local time
Today, 15:51
Joined
Nov 10, 2018
Messages
5
Hello,

I got stuck on something that seems quite simple but I cannot figure this out..
I scouted a lot for an example but my SQL/VBA skills are so basic that if I found it, I didn't recognise it.

In this situation I've got 2 tables.
- First table "TrainProc", contains training information of employees including "Category" of a procedure that they have been trained on.
- Second table "Procedures", is a list of all procedures with another "Category" column for reference.

My aim:
I need to calculate percentage value of completed training.
If for example, an employee has a count of 2 records in "TrainProc" table for a category that has count of 5 in "Procedures" table, then it should return 40%.

Any advice?


Thanks!!
 

Minty

AWF VIP
Local time
Today, 15:51
Joined
Jul 26, 2013
Messages
10,354
You'll need a couple of queries to do this easily. One grouped to count the available Procedures and Categories.

Then add that query that another one that counts the courses taken. Now you can do a simple sum as a calculated field to show the percentage of courses taken.

You can actually do this in one query (with a sub query) but it is more complicated to write. Get used to doing it in stages first.
 
Last edited:

rockovo

New member
Local time
Today, 15:51
Joined
Nov 10, 2018
Messages
5
Thank you Minty! Managed to complete it with your help :)
 

Users who are viewing this thread

Top Bottom