I have 2 data frames. I have to use a mysql query on these 2 frames based on a condition which subtracts the date columns in the 2 frames. So, I am using sqldf package to use data frames in a mysql query, but it is not letting me use DATEDIFF function to subtract dates. Can anyone please let me know how can I solve this problem and use datediff since sqldf is not accepting this function.
Asked
Active
Viewed 1,085 times
1
-
1This question is likely to recive poor atention because of your low aceptance rate. Please go to some of your question an accept the answers there if you find them satisfying to your question. Futhermore, a reproductable example would be usefull, see http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Luciano Selzer Sep 06 '12 at 12:19
-
Luciano: Thanks. I missed that.. Done that now.. Hope someone helps me now.. I am really stuck coz of this issue. :) – Kunal Batra Sep 06 '12 at 12:47
-
Could you make a reproducible example? – Luciano Selzer Sep 06 '12 at 13:30
-
a<-sqldf("select b.id as viewed, c.id as bought, count(c.id) as quantity from b JOIN c on b.email=c.email where datediff(date(c.created),date(b.viewed))<=14 group by 1,2"); This is the code.. – Kunal Batra Sep 07 '12 at 04:22
-
Questions should be reproducible. Cut down your data to a manageable size that still illustrates your problem and post it and your code in the question using `dput`. See http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – G. Grothendieck Jan 04 '14 at 14:54