I have a record which has following structure,
Item ActiveFrom ActiveTo
A 1/01/2015 25/12/2018
I have a Where Condition with Year Value . So whenever i apply a year value ,the records active on that year should be obtained.
for ablove Structure I did,
Select Item,YEAR(ActiveFrom) From Test
UNION
Select Item,YEAR(ActiveTo) From Test
So i get two line items as below,
Item Year
A 2015
A 2018
Now when i Apply where Clause as 2017 this records are not fetched ,so i need output like below,
Item Year
A 2015
A 2016
A 2017
A 2018
Any idea ?