I have Two Dates
Declare @Date1 DateTime
Set @Date1='2015-01-18'
Declare @Date2 DateTime
Set @Date2='2020-04-23'
I have a table of slab to get rate (what was rate on what period)
FeeSlabId Amount SDate EDate
1 500 2011-01-01 00:00:00.000 2019-12-31 00:00:00.000
2 550 2020-01-01 00:00:00.000 2020-12-31 00:00:00.000
Now I need to write SQL, result will show the both rows for the above declared dates.
Secondly, if the declared dates are like below the result will show on row only.
Declare @Date1 DateTime
Set @Date1='2015-01-18'
Declare @Date2 DateTime
Set @Date2='2019-04-23'