Hello Mathias, Thanks for your reply. I have attached a screenshot of my main 3 raws here: I apologize, I have reconciled the dates and deleted the duplicates (i.e., Mar 2009 - July 2017 for the 1st orsid 8760376, instead of keeping it in 2 separate sections). But, unfortunately, my file crashed and I am working on it again. Let me know if this will help with the code for continuous enrollment that I want. For example, the 1st orsid was enrolled from March 2009 - July 2017 (more than 9 months), so he is eligible for my study. Orsid 8749769 was enrolled from November 2008 - May 2009 (less than 9 months, as we can get from the table), so he won't be eligible. There are thousands of ID's in my dataset, so I can't do them manually. I need a code for that and I also want to create a variable that will indicate 1 = eligible and 0 = not, according to equal or more than 9 months and less than that. Thanks again! Farah
... View more