For this query we are going to introduce the concept of loading, editing and running a saved query.
First, download and save this query file to your computer. I suggest saving it in the Best Practice folder under Documents.
Open the Database search tool and click “Load query”. Browse to the query you just downloaded, select it and click “Open”.

Note that the dates in the query are static – adjust them so that the visit date you are looking for is between two years ago and today.
When happy with your query, save it and run it, then save the results.
Advanced Tip: You can see in this screen shot that “Include inactive patients” is not ticked. Ticking it will reset a loaded query back to default. It doesn’t matter, on the second line of our code you can see we are searching for patients that are active OR inactive.