Page 1 of 1
Active patients or patients seen in the last 24 months
Posted: Thu Dec 11, 2014 10:58 am
by jennifer@straine
How to you find your active patients of record or the patients seen in the last 24 months?
Re: Active patients or patients seen in the last 24 months
Posted: Thu Dec 11, 2014 12:06 pm
by Tom Zaccaria
Change the dates according to your needs
# Count of active patients seen between two dates
SET @pos=0;
SELECT Year(ProcDate) AS Year, Month(ProcDate) AS month,
COUNT(DISTINCT patient.PatNum)AS 'Patients'
from patient, procedurelog
WHERE procedurelog.patnum = patient.patnum
AND patient.patstatus = '0'
AND procedurelog.procstatus = 2
AND procedurelog.procdate > '2014-01-01'
AND procedurelog.procdate < '2014-12-31'
GROUP BY YEAR(ProcDate), Month(ProcDate)
ORDER BY YEAR(ProcDate), Month(ProcDate);
drtmz