title: SQL Server : use datetime variable in openquery
body: <p>I try to send a <code>DATETIME</code> variable within a linked server query on a Postgres server within a SQL Server environment.</p>
  
  <p>My code:</p>
  
  <pre><code>DECLARE @start_date DATETIME;
  SET @start_date ='2019-02-01';
  
  SELECT *
  FROM OPENQUERY (postgresDB, 'SELECT id, action_time
                               FROM call_history
                               WHERE action_time &gt; ''' + @start_date + ''' ')
  </code></pre>
  
  <p>I tried to experiment with different numbers of quotation marks around the variable, but I always get this error:</p>
  
  <blockquote>
    <p>Incorrect syntax near '+'</p>
  </blockquote>