Suppose I have this table:

```
CREATE TABLE #t1
(
    PersonID int ,
    ExamDates date,
    Score varchar(50) SPARSE NULL,
);

SET dateformat mdy;

INSERT INTO #t1 (PersonID, ExamDates, Score)
VALUES    (1, '1.1.2018',70),
          (1, '1.13.2018', 100),
          (1, '1.18.2018', 85),
          (2, '1.1.2018', 90),
          (2, '2.1.2018', 95),
          (2, '3.15.2018', 95),
          (2, '7.30.2018', 100),
          (3, '1.1.2018', 80),
          (3, '1.2.2018', 80),
          (3, '5.3.2018', 50),
          (4, '2.1.2018', 90),
          (4, '2.20.2018', 100);

```

I would like to find observations that occurs at least 3 times spanning at least 15 days but no more than 90 days for each unique ID.
My final table should look like this:

| PersonID | ExamDates | Score |
| --- | --- | --- |
| 1 | 1/1/2018 | 70 |
| 1 | 1/13/2018 | 100 |
| 1 | 1/18/2018 | 85 |
| 2 | 1/1/2018 | 90 |
| 2 | 2/1/2018 | 95 |
| 2 | 3/15/2018 | 95 |

We have code working for this using R, but would like to avoid pulling large datasets into R just to run this code. We are doing this in a very large dataset and concerned about efficiency of the query.

Thanks!
-Peter