Hi, all I have 2 datasets, sample datasets below: data1 : id date sequence 234123 2012-02-04 1 234123 2012-01-26 2 234124 2012-02-24 1 234124 2015-05-05 2 data2: id startdate enddate sequence 234123 2010-01-01 2012-01-25 1 234123 2012-01-28 2012-03-05 2 234123 2012-02-14 2012-05-07 3 234124 2012-01-25 2012-02-25 1 234124 2012-02-23 2012-03-24 2 234124 2015-06-24 2015-07-25 3 For the same id, I want to calculate if its date is within any corresponding start date and end date, if the date is within, then give the flag=yes, else flag=no. Each date should have one flag. The final results are below: id date sequence flag 234123 2012-02-04 1 yes 234123 2012-01-26 2 no 234124 2012-02-24 1 yes 234124 2015-05-05 2 no Thank you for any help!
... View more