- cost<- sqlQuery(mysql2,"select * from journal WHERE DATE_FORMAT(CREATE_TIME,'%Y-%m-%d')>='2018-11-17' and DATE_FORMAT(CREATE_TIME,‘%Y-%m-%d’)<='2018-11-23' ")
复制代码
老师我这么写sql,可以读入,但是不是数据框,是
"42000 1064 [MySQL][ODBC 8.0(a) Driver][mysqld-5.7.22-log]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '%m-%d鈥?<='2018-11-23'' at line 1"
[2] "[RODBC] ERROR: Could not SQLExecDirect 'select * from journal WHERE DATE_FORMAT(CREATE_TIME,'%Y-%m-%d')>='2018-11-17' and DATE_FORMAT(CREATE_TIME,‘%Y-%m-%d’)<='2018-11-23' '"
哪里写错了啊,急!