I am getting an error No matching signature for operator >= for argument types: STRING, INT64. Supported signatures: ANY >= ANY at [1:60]
when I run this R
script to fetch some data from BiqQuery
.
我得到了一个错误,没有匹配操作符>=用于参数类型:STRING, INT64。支持签名:当我运行这个R脚本从BiqQuery获取一些数据时,任何>=任何值[1:60]。
This is where I get the error:
这就是我的错误所在:
a <- dbGetQuery(db,
paste0("select * from dta.tbl where col1='",
somevariable"' and date>=",substr(gsub("\\D","",as.character(start.date)),3,8),
" and date<=",substr(gsub("\\D","",as.character(end.date)),3,8)))
Any clue on how do I get rid of this error? I am using standardsql here
关于如何消除这个错误有什么线索吗?我在这里使用的是standardsql
Thanks ahead! :)
谢谢吧!:)
2 个解决方案
#1
3
from brief glance - try below
从简单的一瞥-尝试下面。
a <- dbGetQuery(db,
paste0("select * from dta.tbl where col1='",
somevariable,"' and date>='",substr(gsub("\\D","",as.character(start.date)),3,8),
"' and date<='",substr(gsub("\\D","",as.character(end.date)),3,8), "'"))
#2
0
It looks like you just need quotes.
看起来你只需要引用。
and date>='",substr(gsub("\\D","",as.character(start.date)),3,8),"' and date<='",substr(gsub("\\D","",as.character(end.date)),3,8), "'"))
#1
3
from brief glance - try below
从简单的一瞥-尝试下面。
a <- dbGetQuery(db,
paste0("select * from dta.tbl where col1='",
somevariable,"' and date>='",substr(gsub("\\D","",as.character(start.date)),3,8),
"' and date<='",substr(gsub("\\D","",as.character(end.date)),3,8), "'"))
#2
0
It looks like you just need quotes.
看起来你只需要引用。
and date>='",substr(gsub("\\D","",as.character(start.date)),3,8),"' and date<='",substr(gsub("\\D","",as.character(end.date)),3,8), "'"))