2968_en-US
latest date within a rangeIn my data, each subject has been observed 1-10 times. The dates of these observations are in separate columns: date1, date2... date10. How can I write a function that will choose the latest of these dates within a defined range? If I simply wanted the latest overall, it would just be a maximum function, but what if I want the latest date within 2009, for example? Can anybody see a way to get this?
Thanks.Re: latest date within a rangeYou can use sort and interpolate after putting the dates into an array. Say the dates are numbers and you're looking for the one before 100:
You need to check for i being 0 in case all the dates are below 100.
Comments
There are no comments yet