我运行了以下查询,但无法理解该错误。
data <-
sqldf('SELECT Contract_Code,
sum(case when format(as.Date(status_dt)),"%Y-%m")= format(as.Date(AddMonths(Start_date,0))), "%Y-%m")
then Late_days else NULL end) as F01
from df11
group by Contract_Code')
Error in result_create(conn@ptr, statement) : near "as": syntax error