(sorry if a duplicate pops through ...)
Jérôme Lemaître wrote:
> Dear alls,
> 
> Could someone tell me how to select a subset of string observations (e.g.
> "females" in a sex column) with sqlQuery in the RODBC library?
> 
> Indeed, I'm trying to select a subset of observations on my access database
> with:
> 
> female<-sqlQuery(mychannel,"SELECT Micromammiferes.sex
> FROM Micromammiferes
> WHERE (((Micromammiferes.sex)="females"));")
> 
> The sql works well in access but in R, I keep getting:
> 
> Error: syntax error.

Most computer software has problems with nested quote characters.

Ie:

 > x = "SELECT Micromammiferes.sex FROM Micromammiferes WHERE
(((Micromammiferes.sex)="females"));"

also results in a syntax error (my mailer split the line).

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to