Usually, variables can be passed to SQL statements using paste. Interestingly this doesn\'t work with input variables in R shiny. Using the below code I get the following er
For flexibility you can also use sub function to substitute part of the query string, this is quite clean approach
table <- reactive({
my_query <- 'SELECT a,b FROM table1 WHERE id = SOMETHING AND created_at >= 2015-08-01'
my_query <- sub("SOMETHING",input$segment,my_query)
dbGetQuery(database,noquote(my_query))
})