Skip to content

Getting the Number of People Who Have Visited

How to create a query that returns the number of visitors (not the number of visits).

Q:Adam Nims wants to create a query that returns the number of patients who have visited (not the number of visits).  Each patient should be counted only once, regardless of the number of visits.

A: This can be done with a Totals query based on a Select query.  Make a Select query based on the table, with the Patient ID (or other appropriate field) and other necessary fields (but not the Date field).  In the query Properties sheet, set Unique values to Yes (so each patient appears only once).  Save this query, and make a query based on it.  Click the Totals (big Sigma) button on the toolbar in the Query Designer, then select Count for the Total row of the PatientID column.  This will yield the number of separate patients.

About this author