title: SQL linked server, open query using variable
body: <pre><code>SELECT * INTO #C_INFO FROM OPENQUERY(ORACLE_CMIDW1,' SELECT A.CID, A.ANO,
  A.COMP_REVD_DATE, A.REVIEW_COMP_DATE, A.ISSUE, B.ENT_ID, A.TYPE_ID FROM XXX
  B INNER JOIN YYY A ON B.ANO = A.ANO WHERE A.REVIEW_COMP_DATE Between
  ''2012-03-01'' And ''2013-10-31'' AND Not A.ISSUE = 110 AND A.TYPE_ID = 1
  and B.ENT_ID In (2,3) ')
  </code></pre>
  
  <p>Above sql works perfect but i dont want to hard code the dates. That's the reason trying to use variable. date format <code>(yyyy-mm-dd, '2013-03-01')</code>, anything other than this date format, Oracle doesn't execute the sql.</p>
  
  <p>Is it possible to do this, If so please re write the whole sql using variable so that i can see how it can be done.</p>
  
  <p>Thanks!</p>