Important Content Update Message
We are currently updating the OP Help Center content for the release of OP 20. OP 20 (official version 20.0.x) is the certified, 2015 Edition, version of the Office Practicum software. This is displayed in your software (Help tab > About) and in the Help Center tab labeled Version 20.0. We appreciate your patience as we continue to update all of our content.

SQL: Vaccine Count for Active Patients


This report shows all active patients and the number of vaccines they have had recorded in their chart.  Blank means 0. You can change the dropdown filter to show only blanks.

A sample image of this SQL report run in the Database Viewer is shown below:


  • Only active patients are included.
  • The vaccines shown are both vaccines given by your practice and legacy vaccines. 
  • A child might have a blank record if the patient has never received any vaccines (either newborn or total vaccine refuser), or if you simply don’t have a vaccine record for that patient recorded in OP yet.


To highlight and copy the code below to your clipboard, simply click the Copy button.

select register.patno, fname, lname, birthdat, t as total_vaccines from register
left outer join

select register.patno, t from register
left outer join (select patno, count(vacname) as t from vaccine1 group by patno) v on v.patno = register.patno
where status_pat = 'ACTIVE'
) u  on u.patno = register.patno
where status_pat = 'ACTIVE' and patno > 99