I have a project that relies on researching Date between two periods.
Things are going well, except for three cases.
The first case: If the end of the period is not specified in the database .
The second case: If the end date of the period is not specified in the search .
The third case: If the period has no end, and the search has not specified an end date for the period.
Example : In the database the period from: (2020-09-25) has no end:
In the search for periods window, we leave the end date of the period blank

I used this code to get around the problem, but this code is not practical and may cause problems in the future, as I make it add 100 years to the start date of the endless period.
List<Tax_Value> g = (
from i in Tax.Tax_Value
.Where
(L =>
L.End_Date.HasValue?
L.End_Date >= this.Start_Date.ToDate : this.Start_Date.ToDate.Value.AddYears(100) >= this.Start_Date.ToDate
&
this.End_Date.ToDate.HasValue ?
L.Start_Date <= this.End_Date.ToDate : L.Start_Date <= this.Start_Date.ToDate.Value.AddYears(100))
select i).ToList();
Update : There are some dates that get errors, for example: The start of the period is less than the start date of the search for the period, so the period does not appear. The search is to extract all the periods between the two dates, noting that some periods have their start date less than the start date of the search for the period
