I am trying to make a query that can identify if the EndDate lies between the first PlanTerminationDate and the second PlanEffectiveDate of a particular ID.
+----+-------------------+---------------------+------------+------------+
| ID | PlanEffectiveDate | PlanTerminationDate | StartDate | EndDate |
+----+-------------------+---------------------+------------+------------+
| 11 | 2/9/2019 | 11/18/2020 | 12/26/2019 | 11/26/2020 |
| 11 | 1/7/2021 | 1/25/2021 | 12/26/2019 | 11/26/2020 |
| 12 | 10/9/2018 | 4/13/2020 | 6/5/2019 | 5/6/2020 |
| 12 | 6/19/2020 | 9/16/2020 | 6/5/2019 | 5/6/2020 |
+----+-------------------+---------------------+------------+------------+
For example: For ID 11, the EndDate 11/26/2020 lies between 11/18/2020 and 1/7/2021.