Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Count of the number of appointments that each customer has made – Microsoft Access SQL

I am trying to create a SQL query in Microsoft access that is able to count of the number of
appointments that each customer has made but have been unsuccessful so far. I have two separate tables, one for appointment and one for customers as listed below.

Appointment

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Customer

enter image description here

>Solution :

You will need to do some aggregation:

SELECT Customer.Customer_ID, Customer.Name, Customer.Lastname, COUNT(*)
FROM Customer
JOIN Appointment
ON Customer.Customer_ID = Appointment.Customer_ID
WHERE Attended <> 'Yes'
GROUP BY Customer.Customer_ID, Customer.Name, Customer.Lastname;

I have no MS Access in front of me, so if there is a typo, let me know!

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading