0

I suspect this is very simple but couldn't work out how do it, nor find an answer on the internet. I have a table T in a data warehouse which I want to query through the R console e.g.

library(RJDBC)

query = function(date){
  paste('select * from T where date =', date, sep = ' ')
  return(query)
  }    

However, I become unstuck as query('01/01/2013') returns:

 select * from T where date = 01/01/2013

whereas I actually want it to return:

select * from T where date = '01/01/2013'

Thanks for any help. Cheers

4

1 回答 1

1

用双引号试试:

query("'01/01/2013'")

高温高压

于 2013-02-26T12:34:30.737 回答