I have a sql query below that works just fine.
Select * from dbo.Employee where StartDate between '08/01/2014' and '08/31/2014' order by StartDate
I am modifying this query such that it takes date input from shiny UI (daterange) .
sqlQuery(myconn, paste("Select * from dbo.Employee where StartTime between", "'as.character(input$daterange[1])'", "and", "'as.character(input$daterange[2])'", "order by StartTime"))
I get an error
[1,] "22007 241 [Microsoft][SQL Server Native Client 10.0][SQL Server]Conversion failed when converting date and/or time from character string."
[,2] "[RODBC] ERROR: Could not SQLExecDirect ' Select * from..... Where StartDate between 'as.character(input$daterange[1])' and 'as.character(input$daterange[2])' order by StartDate '"
Not sure how to fix this query such that it takes date input from shiny UI, need help.
I use
sub
function to do that, by simply using regular expressions like so: