Rstudio and Snowflake Help, dbGetQuery not working when trying to run Where clause

0

Trying to pull in a snowflake table with a where clause where the snapshot date is a date and "Date1" is a data value i set earlier in the R code, but this statement is returning a blank output and i know it is because of the where clause, but i cant get the where clause to work as intended.

date1 <- "2024-03-02"

file1 <- dbGetQuery(myconn,paste(" SELECT Year,Month, Origin, CAST(Snapshot_Date as Date) as Snapshot_Date FROM SNOWFLAKE_TABLE WHERE CAST(Snapshot_Date as date) = CAST(',"'",date1,"'",' as date)'))

I am expecting the file1 data to be filtered for snapshot_dates that are = to "2024-03-02"

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.