user1111
user1111

Reputation: 331

BigQuery error: No matching signature for operator >=

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

Answers (2)

Mikhail Berlyant
Mikhail Berlyant

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

Elliott Brossard
Elliott Brossard

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

Related Questions