I’m trying to write a query that brings back patients who have had an office visit at least a year before the most recent one. The various ways I’m thinking of get all twisted up in my head, so I was wondering if anyone out there can see an obvious way to write it that I’m missing. Don’t worry too much about the exact syntax and naming — I should be able to translate it. 🙂
Thanks!
If you want to determine whether a patient has been treated for at least a year (which your comment makes it sound like) then couldn’t you do a query like:
I don’t know if that syntax will work offhand, but the concept is to say, “Return only those patients where the number of days since their earliest and most recent appointments is at least 365 days.