Reputation: 2096
I have Access database and I'm using VB.NET. DB has two tables
I have columns I want from technicians table in datagrid, but I want to have extra column which should show how many faults every technician fixed based on the Faults table(so I think query will need to run for every row). Is this even possible?
Big Thank you for any help
Upvotes: 1
Views: 823
Reputation: 21
You will need to specify which columns you want to add in the form's Load() method and enable autogenerate columns property for gridview to true.
Upvotes: 1
Reputation: 26386
That should be
SELECT technicians.techname, count(*) AS NoOfFaults
FROM technicians
LEFT JOIN faults ON technicians.ID = faults.TechnicianID
GROUP BY technicians.techname;
Upvotes: 1