title: Execute SQL Server Stored Procedure in R
body: <p>I have a problem when I execute a SQL Server 2008 stored procedure in R. The execution in R follows as:</p>
  
  <hr>
  
  <pre><code>library(RODBC)
  
  dbhandle &lt;- odbcDriverConnect('driver={SQLServer};server=xxx;database=xxx;trusted_connection=true') 
  
  data &lt;-sqlquery(dbhandle, "EXEC ihshsf35.FPR_GET_PF10  @tipo_pes='F' , @date_process='2016-11-30'") 
  
  odbcCloseAll() 
  </code></pre>
  
  <hr>
  
  <p>The error that appears in R:</p>
  
  <pre><code>Error in as.POSIXlt.character(x, tz, ...) : 
   character string is not in a standard unambiguous format
  </code></pre>
  
  <hr>
  
  <p>The stored procedure calls a characteristic and a date to extracts information from the database:</p>
  
  <pre><code>Procedure [ihshsf35].[FPR_GET_PF10] 
  ( 
          @tipo_pes varchar(1), 
          @date_process as datetime 
  ) 
  AS 
  BEGIN 
  </code></pre>
  
  <hr>
  
  <p>I don´t have problems executing this stored procedure from other systems like SAS and SPSS, but when I try in R brings me a error.
  Note: In SQL server the data has the format "aaaa-mm-dd" the same I asking in R</p>
  
  <p>Can anyone can help me with the problem in R?</p>
  
  <p>Thanks in advance</p>