>but i guess you want this:
>
>SELECT Visits.Patient_Name
>, count(DISTINCT Visits.Doctor_Name) AS Number_Of_Doctors,
>, count(DISTINCT Doctors.Doctor_Specialty) AS Number_Of_Specialities
>FROM Doctors
>inner join Visits on Doctors.Doctor_Name = Visits.Doctor_Name
>GROUP BY Visits.Patient_Name;
>
I think it would work. I don't have Access here at work, have to wait till I get home.
Here are two more problems:
Find which patients went to two or more doctors with the same specialty on the same day.
Find which patients went to two or more doctors with different specialties on the same day.
For these two queries we need to return the patient name, the date, the name of each doctor, and the doctor's specialty.
If it's not broken, fix it until it is.
My Blog