title: In SSIS expression how can we store only date from getdate()
body: <p>I want to store the date from the getdate()-1 in SSIS variables.</p>
  
  <p>Something like when we run the sql query </p>
  
  <pre><code>select CONVERT(varchar(10),getdate()-1,120)
  </code></pre>
  
  <blockquote>
    <p>Output - 2017-11-10</p>
  </blockquote>
  
  <p>I tried the below query in the expression.</p>
  
  <pre><code>@[User::Dates]  =  
             (DT_WSTR,4)YEAR(GETDATE())  
  + RIGHT ( "0" + (DT_WSTR,2)MONTH(GETDATE()),2) 
  + RIGHT ( "0" + (DT_WSTR,2)DAY(GETDATE()),2)
  </code></pre>
  
  <p>And it gives me the output as </p>
  
  <blockquote>
    <p>20171111</p>
  </blockquote>
  
  <p>Can someone tell me what will the expression for the variable. My datatype for variable is string</p>