Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying Zero values from a count

Status
Not open for further replies.

Delboy14

Programmer
Jun 21, 2001
213
GB
Access2002

I have a query which counts the number of patients on a certain drug, it returns a count of the number of patients on this drug per doctors practice. This works fine except, I would like it to display 0 for practices that have no patients on the drug, this is my current code and the table displayed, does anyone know what to add, thankyou

Code:
SELECT Count(ConsultsQueryLast.PatientIndex) AS NumOfPatients, ConsultsQueryLast.PracticeID
FROM ConsultsQueryLast, FailureLastConsult
WHERE (ConsultsQueryLast.Drug2<>&quot;&quot;) AND FailureLastConsult.PatientIndex=ConsultsQueryLast.PatientIndex
GROUP BY ConsultsQueryLast.PracticeID;

NumOfPAtients PracticeID
4 {404DUND}
2 {123ABER}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top