I am trying to automate a code where I am pulling data for the last week and run it once in a week. How can I get the Sys.Date() inside an sql query in R.
library('RJDBC')
Tdata<- dbGetQuery(conn, "select roll_id,source,create_date,login from master_data where create_date>'2017-07-17'")
So basically i want to create condition create_date> Sys.Date()-7. How to do it?