Reputation: 331
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
.
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
Thanks ahead! :)
Upvotes: 3
Views: 14602
Reputation: 173190
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), "'"))
Upvotes: 3
Reputation: 33765
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), "'"))
Upvotes: 0