I want to apply the following query to my database. P2<-sqlQuery(ch1,'select *, TimeStamp_Local, ref_density, ref_dewpoint, ref_dir, ref_precip, ref_press, ref_rh, ref_snowfall, ref_snowdepth, ref_temperature_avg, ref_temperature_max, ref_temperature_min, ref_ws_avg, ref_ws_max, ref_wetbulb FROM ASOS.dbo.DailyData DD left outer join ASOS.dbo.ASOS_MetaData MD on MD.WBAN = DD.WBAN where CallSign = 'BOS' order by TimeStamp_Local ASC')
where ch1 <- odbcConnect(dsn="SQLBI01", uid="DataPull", pwd="PullData") in R (RODBC). I am running into the following error Error: unexpected symbol in: " left outer join ASOS.dbo.ASOS_MetaData MD on MD.WBAN = DD.WBAN, where CallSign = 'BOS" I don't know why Thanks, Alemu [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.