@ActivePatCount

For users or potential users.
Post Reply
ddddd
Posts: 1
Joined: Sat Sep 01, 2018 8:04 am

@ActivePatCount

Post by ddddd » Sat Sep 01, 2018 8:07 am

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

Tom Zaccaria
Posts: 353
Joined: Mon Feb 25, 2008 3:09 am

Re: @ActivePatCount

Post by Tom Zaccaria » Mon Sep 03, 2018 2:58 am

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

Post Reply