title: SSIS expression how to convert DateTime SQL statement ole db source?
body: <p>when i put this code on the ole db source (sql commnd from variable ) :</p>
  
  <pre><code>"select * from [DistrisysDW].[dbo].[Wrk_Agreg_Faible] where cast(Dat_Echeance as date)= "+ @[User::p_Date_Ref] +" ;"    
  </code></pre>
  
  <p>i have this error message :</p>
  
  <pre><code>   "The data types "DT_WSTR" and "DT_DATE" are incompatible for the binary operator "+".
   Can not perform implicit type conversion operands compatible types for the operation. 
  To perform this operation, an explicit conversion of one or both of the operands must be
   made with a conversion operator.
  Failed to result type definition of the binary operation
   "" select * from [DistrisysDW]. [Dbo]. [Wrk_Agreg_Faible] 
  where cast (as Dat_Echeance date) = "+ @ [User :: p_Date_Ref]." Error Code: 0xC0047080."
  </code></pre>
  
  <p>Dat_Echeance is a smalldatetime and <code>@[User::p_Date_Ref]</code> is my parameter, its datatype is a <code>Datetime</code>.</p>
  
  <p>(i have sql server 2008R2)</p>