This is to underscore that Jeph's solution is better than mine.
Nick
On Tue, Mar 5, 2013 at 7:47 PM, Michael Stewart
<michaelstewartresearch@gmail.com> wrote:
> Thank you for so many responses
> I will go through them all and let you know
> The reason I didnt put my code .. I was hopelessly lost
> I fiddled with using inrange and inlist commands but was going nowhere.
On Tue, Mar 5, 2013 at 2:42 PM, Nick Cox <njcoxstata@gmail.com> wrote:
>> Nice.
On Tue, Mar 5, 2013 at 7:39 PM, Jeph Herrin <stata@spandrel.net> wrote:
>>> forv y=2009/2012 {
>>> gen used_`y'= inrange(`y',yofd(startdate),yofd(stopdate))
>>>
>>> }
>>>
>>>
>>>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/