Going by the definition of "active" being any patient seen within the last three years, let's expand upon that:

"An Active Patient is any patient seen at least once in the past three years that resulted in an Encounter in Amazing Charts being generated." We don't like using the appointment scheduler as it is not quite as accurate.

The SQL Query below will show all patients that have at least one encounter within the past three years up to 3/15/2017. You can always change the dates.

Code
DECLARE @StartDate DATETIME
DECLARE @EndDate DATETIME

SET @StartDate = '1/1/2014'
SET @EndDate = '3/15/2016'

SELECT Demographics.PatientID, [Last] as LastName, [First] as FirstName, Gender, BirthDate FROM Demographics INNER JOIN 
(SELECT DISTINCT PatientID FROM Billing WHERE DateOfService BETWEEN @StartDate AND @EndDate) as a on Demographics.PatientID = a.PatientID ORDER BY LastName

JamesNT



James Summerlin
My personal site: http://www.dataintegrationsolutions.net
james@dataintegrationsolutions.net