0

I have an sql query that works well with 1 input parameter e.g.

mydf1=dbGetQuery(con2, paste0("select month from incoming where to_char(TO_TIMESTAMP(vessel_servertimestamp, 'YYYY-MM-DD HH24:MI:SS'), 'MON') in  '",input$dataset1,"' 
group by  month "))

How do construct an sql query to pass multiple input parameters? Below is the selectInput..

output$dataset1 =renderUI({
      selectInput("dataset1", "Choose month:", 
                  choices  = as.list(c("JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP","OCT","NOV","DEC")),
                  multiple = TRUE)
    })

1 Answer 1

2

You need change sql part with input$dataset to

in (", paste0("'", input$dataset1, "'", collapse = ","), ") group_by month"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.