Am running a Query
The following is in the Query:
@ActivePatCount
Its parameters are what?
I assume it is patients seen during a time range. Does the time range vary?
D
@ActivePatCount
-
- Posts: 361
- Joined: Mon Feb 25, 2008 3:09 am
Re: @ActivePatCount
This will give you the number of patients that visited at least one time over the last 18 months.
For a longer or shorter time in the past change the '....interval 18 month;' to what ever you want.
/*22 Count patients seen in last 18 months*/
Set @FromDate = curdate()-interval 18 month;
set @ToDate = Curdate();
SELECT COUNT(DISTINCT PatNum) FROM procedurelog
WHERE ProcStatus=2
AND ProcDate Between @FromDate and @ToDate
drtmz
For a longer or shorter time in the past change the '....interval 18 month;' to what ever you want.
/*22 Count patients seen in last 18 months*/
Set @FromDate = curdate()-interval 18 month;
set @ToDate = Curdate();
SELECT COUNT(DISTINCT PatNum) FROM procedurelog
WHERE ProcStatus=2
AND ProcDate Between @FromDate and @ToDate
drtmz