11 Aug 18 · David-Spring · #Bigquery ·   Bookmark   ×

Google BigQuery error: No matching signature for operator >=

Error Message: No matching signature for operator >= for argument types: STRING, INT64. Supported signatures: ANY >= ANY at [1:60] 

while running the below 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)))


The data values are missing the single quote enclosure. eg date >='2019-01-01', it should work after adding the single quotes

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), "'"))


posted on 11 Aug 18

Enjoy great content like this and a lot more !

Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds