Active patients or patients seen in the last 24 months
-
- Posts: 1
- Joined: Thu Dec 11, 2014 10:53 am
Active patients or patients seen in the last 24 months
How to you find your active patients of record or the patients seen in the last 24 months?
-
- Posts: 361
- Joined: Mon Feb 25, 2008 3:09 am
Re: Active patients or patients seen in the last 24 months
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
# 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