Re: [R] Using extract function for dates in sqldf

2012-03-21 Thread Gabor Grothendieck
On Wed, Mar 21, 2012 at 11:31 AM, wrote: > > I'm trying to use sqldf to query for the earliest date of a blood test when > patients have had multiple tests in a given year. My query looks like this: > > test11 <- sqldf("select CHILD_ID, min(SAMP_DATE) >                 from lab >                

[R] Using extract function for dates in sqldf

2012-03-21 Thread Michael . Laviolette
I'm trying to use sqldf to query for the earliest date of a blood test when patients have had multiple tests in a given year. My query looks like this: test11 <- sqldf("select CHILD_ID, min(SAMP_DATE) from lab group by CHILD_ID having extract (ye